@STATIC;1.0;p;15;_CPCornerView.jt;1245;@STATIC;1.0;i;8;CPView.jt;1214;
objj_executeFile("CPView.j",YES);
var _1=objj_allocateClassPair(CPView,"_CPCornerView"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("_init"),function(_3,_4){
with(_3){
objj_msgSend(_3,"setBackgroundColor:",objj_msgSend(CPColor,"colorWithPatternImage:",CPAppKitImage("tableview-headerview.png",CGSizeMake(1,23))));
}
}),new objj_method(sel_getUid("initWithFrame:"),function(_5,_6,_7){
with(_5){
if(_5=objj_msgSendSuper({receiver:_5,super_class:objj_getClass("_CPCornerView").super_class},"initWithFrame:",_7)){
objj_msgSend(_5,"_init");
}
return _5;
}
}),new objj_method(sel_getUid("drawRect:"),function(_8,_9,_a){
with(_8){
var _b=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort");
CGContextSetStrokeColor(_b,objj_msgSend(CPColor,"colorWithHexString:","dce0e2"));
var _c=[CGPointMake(_a.origin.x,_a.origin.y+0.5),CGPointMake(_a.origin.x,_a.origin.y+_a.size.height)];
CGContextStrokeLineSegments(_b,_c,2);
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_d,_e,_f){
with(_d){
_d=objj_msgSendSuper({receiver:_d,super_class:objj_getClass("_CPCornerView").super_class},"initWithCoder:",_f);
objj_msgSend(_d,"_init");
return _d;
}
})]);
p;18;_CPDisplayServer.jt;1144;@STATIC;1.0;t;1125;
var _1=[],_2={},_3=[],_4={},_5=objj_msgSend(CPRunLoop,"mainRunLoop");
_CPDisplayServerAddDisplayObject=function(_6){
var _7=objj_msgSend(_6,"UID");
if(typeof _2[_7]!=="undefined"){
return;
}
var _8=_1.length;
_2[_7]=_8;
_1[_8]=_6;
};
_CPDisplayServerAddLayoutObject=function(_9){
var _a=objj_msgSend(_9,"UID");
if(typeof _4[_a]!=="undefined"){
return;
}
var _b=_3.length;
_4[_a]=_b;
_3[_b]=_9;
};
var _c=objj_allocateClassPair(CPObject,"_CPDisplayServer"),_d=_c.isa;
objj_registerClassPair(_c);
class_addMethods(_d,[new objj_method(sel_getUid("run"),function(_e,_f){
with(_e){
while(_3.length||_1.length){
var _10=0;
for(;_10<_3.length;++_10){
var _11=_3[_10];
delete _4[objj_msgSend(_11,"UID")];
objj_msgSend(_11,"layoutIfNeeded");
}
_3=[];
_4={};
_10=0;
for(;_10<_1.length;++_10){
if(_3.length){
break;
}
var _11=_1[_10];
delete _2[objj_msgSend(_11,"UID")];
objj_msgSend(_11,"displayIfNeeded");
}
if(_10===_1.length){
_1=[];
_2={};
}else{
_1.splice(0,_10);
}
}
objj_msgSend(_5,"performSelector:target:argument:order:modes:",sel_getUid("run"),_e,nil,0,[CPDefaultRunLoopMode]);
}
})]);
objj_msgSend(_CPDisplayServer,"run");
p;21;_CPImageAndTextView.jt;12848;@STATIC;1.0;I;21;Foundation/CPString.ji;9;CPColor.ji;8;CPFont.ji;9;CPImage.ji;8;CPView.ji;11;CPControl.jt;12736;
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("CPColor.j",YES);
objj_executeFile("CPFont.j",YES);
objj_executeFile("CPImage.j",YES);
objj_executeFile("CPView.j",YES);
objj_executeFile("CPControl.j",YES);
var _1=1<<0,_2=1<<1,_3=1<<2,_4=1<<3,_5=1<<4,_6=1<<5,_7=1<<6,_8=1<<7,_9=1<<8,_a=1<<9,_b=1<<10;
var _c=3,_d=5;
var _e=objj_allocateClassPair(CPView,"_CPImageAndTextView"),_f=_e.isa;
class_addIvars(_e,[new objj_ivar("_alignment"),new objj_ivar("_verticalAlignment"),new objj_ivar("_lineBreakMode"),new objj_ivar("_textColor"),new objj_ivar("_font"),new objj_ivar("_textShadowColor"),new objj_ivar("_textShadowOffset"),new objj_ivar("_imagePosition"),new objj_ivar("_imageScaling"),new objj_ivar("_image"),new objj_ivar("_text"),new objj_ivar("_textSize"),new objj_ivar("_flags"),new objj_ivar("_DOMImageElement"),new objj_ivar("_DOMTextElement"),new objj_ivar("_DOMTextShadowElement")]);
objj_registerClassPair(_e);
class_addMethods(_e,[new objj_method(sel_getUid("initWithFrame:control:"),function(_10,_11,_12,_13){
with(_10){
_10=objj_msgSendSuper({receiver:_10,super_class:objj_getClass("_CPImageAndTextView").super_class},"initWithFrame:",_12);
if(_10){
_textShadowOffset={width:0,height:0};
objj_msgSend(_10,"setVerticalAlignment:",CPTopVerticalTextAlignment);
if(_13){
objj_msgSend(_10,"setLineBreakMode:",objj_msgSend(_13,"lineBreakMode"));
objj_msgSend(_10,"setTextColor:",objj_msgSend(_13,"textColor"));
objj_msgSend(_10,"setAlignment:",objj_msgSend(_13,"alignment"));
objj_msgSend(_10,"setVerticalAlignment:",objj_msgSend(_13,"verticalAlignment"));
objj_msgSend(_10,"setFont:",objj_msgSend(_13,"font"));
objj_msgSend(_10,"setImagePosition:",objj_msgSend(_13,"imagePosition"));
objj_msgSend(_10,"setImageScaling:",objj_msgSend(_13,"imageScaling"));
}else{
objj_msgSend(_10,"setLineBreakMode:",CPLineBreakByClipping);
objj_msgSend(_10,"setAlignment:",CPCenterTextAlignment);
objj_msgSend(_10,"setFont:",objj_msgSend(CPFont,"systemFontOfSize:",12));
objj_msgSend(_10,"setImagePosition:",CPNoImage);
objj_msgSend(_10,"setImageScaling:",CPScaleNone);
}
_textSize=NULL;
}
return _10;
}
}),new objj_method(sel_getUid("initWithFrame:"),function(_14,_15,_16){
with(_14){
return objj_msgSend(_14,"initWithFrame:control:",_16,nil);
}
}),new objj_method(sel_getUid("setAlignment:"),function(_17,_18,_19){
with(_17){
if(_alignment===_19){
return;
}
_alignment=_19;
switch(_alignment){
case CPLeftTextAlignment:
_DOMElement.style.textAlign="left";
break;
case CPRightTextAlignment:
_DOMElement.style.textAlign="right";
break;
case CPCenterTextAlignment:
_DOMElement.style.textAlign="center";
break;
case CPJustifiedTextAlignment:
_DOMElement.style.textAlign="justify";
break;
case CPNaturalTextAlignment:
_DOMElement.style.textAlign="";
break;
}
}
}),new objj_method(sel_getUid("alignment"),function(_1a,_1b){
with(_1a){
return _alignment;
}
}),new objj_method(sel_getUid("setVerticalAlignment:"),function(_1c,_1d,_1e){
with(_1c){
if(_verticalAlignment===_1e){
return;
}
_verticalAlignment=_1e;
_flags|=_5;
objj_msgSend(_1c,"setNeedsLayout");
}
}),new objj_method(sel_getUid("verticalAlignment"),function(_1f,_20){
with(_1f){
return _verticalAlignment;
}
}),new objj_method(sel_getUid("setLineBreakMode:"),function(_21,_22,_23){
with(_21){
if(_lineBreakMode===_23){
return;
}
_lineBreakMode=_23;
_flags|=_6;
objj_msgSend(_21,"setNeedsLayout");
}
}),new objj_method(sel_getUid("lineBreakMode"),function(_24,_25){
with(_24){
return _lineBreakMode;
}
}),new objj_method(sel_getUid("setImagePosition:"),function(_26,_27,_28){
with(_26){
if(_imagePosition==_28){
return;
}
_imagePosition=_28;
_flags|=_a;
objj_msgSend(_26,"setNeedsLayout");
}
}),new objj_method(sel_getUid("imagePosition"),function(_29,_2a){
with(_29){
return _imagePosition;
}
}),new objj_method(sel_getUid("setImageScaling:"),function(_2b,_2c,_2d){
with(_2b){
if(_imageScaling==_2d){
return;
}
_imageScaling=_2d;
_flags|=_b;
objj_msgSend(_2b,"setNeedsLayout");
}
}),new objj_method(sel_getUid("imageScaling"),function(_2e,_2f){
with(_2e){
return _imageScaling;
}
}),new objj_method(sel_getUid("setTextColor:"),function(_30,_31,_32){
with(_30){
if(_textColor===_32){
return;
}
_textColor=_32;
_DOMElement.style.color=objj_msgSend(_textColor,"cssString");
}
}),new objj_method(sel_getUid("textColor"),function(_33,_34){
with(_33){
return _textColor;
}
}),new objj_method(sel_getUid("setFont:"),function(_35,_36,_37){
with(_35){
if(_font===_37){
return;
}
_font=_37;
_flags|=_8;
_textSize=NULL;
objj_msgSend(_35,"setNeedsLayout");
}
}),new objj_method(sel_getUid("font"),function(_38,_39){
with(_38){
return _font;
}
}),new objj_method(sel_getUid("setTextShadowColor:"),function(_3a,_3b,_3c){
with(_3a){
if(_textShadowColor===_3c){
return;
}
_textShadowColor=_3c;
_flags|=_9;
objj_msgSend(_3a,"setNeedsLayout");
}
}),new objj_method(sel_getUid("textShadowColor"),function(_3d,_3e){
with(_3d){
return _textShadowColor;
}
}),new objj_method(sel_getUid("setTextShadowOffset:"),function(_3f,_40,_41){
with(_3f){
if((_textShadowOffset.width==_41.width&&_textShadowOffset.height==_41.height)){
return;
}
_textShadowOffset={width:_41.width,height:_41.height};
objj_msgSend(_3f,"setNeedsLayout");
}
}),new objj_method(sel_getUid("textShadowOffset"),function(_42,_43){
with(_42){
return _textShadowOffset;
}
}),new objj_method(sel_getUid("setImage:"),function(_44,_45,_46){
with(_44){
if(_image==_46){
return;
}
if(objj_msgSend(_image,"delegate")===_44){
objj_msgSend(_image,"setDelegate:",nil);
}
_image=_46;
_flags|=_2;
if(objj_msgSend(_image,"loadStatus")!==CPImageLoadStatusCompleted){
objj_msgSend(_image,"setDelegate:",_44);
}
objj_msgSend(_44,"setNeedsLayout");
}
}),new objj_method(sel_getUid("imageDidLoad:"),function(_47,_48,_49){
with(_47){
if(_49===_image){
_flags|=_2;
objj_msgSend(_47,"setNeedsLayout");
}
}
}),new objj_method(sel_getUid("image"),function(_4a,_4b){
with(_4a){
return _image;
}
}),new objj_method(sel_getUid("setText:"),function(_4c,_4d,_4e){
with(_4c){
if(_text===_4e){
return;
}
_text=_4e;
_flags|=_3;
_textSize=NULL;
objj_msgSend(_4c,"setNeedsLayout");
}
}),new objj_method(sel_getUid("text"),function(_4f,_50){
with(_4f){
return _text;
}
}),new objj_method(sel_getUid("layoutSubviews"),function(_51,_52){
with(_51){
var _53=_imagePosition!==CPImageOnly&&(objj_msgSend(_text,"length")>0),_54=!!_DOMTextElement;
if(_53!==_54){
if(_54){
_DOMElement.removeChild(_DOMTextElement);
_DOMTextElement=NULL;
_54=NO;
}else{
_DOMTextElement=document.createElement("div");
var _55=_DOMTextElement.style;
_55.position="absolute";
_55.whiteSpace="pre";
_55.zIndex=200;
_55.overflow="hidden";
_DOMElement.appendChild(_DOMTextElement);
_54=YES;
_flags|=_3|_8|_6;
}
}
var _55=_54?_DOMTextElement.style:nil;
var _56=_54&&!!_textShadowColor,_57=!!_DOMTextShadowElement;
if(_56!==_57){
if(_57){
_DOMElement.removeChild(_DOMTextShadowElement);
_DOMTextShadowElement=NULL;
_57=NO;
}else{
_DOMTextShadowElement=document.createElement("div");
var _58=_DOMTextShadowElement.style;
_58.font=objj_msgSend(_font?_font:objj_msgSend(CPFont,"systemFontOfSize:",12),"cssString");
_58.position="absolute";
_58.whiteSpace=_55.whiteSpace;
_58.wordWrap=_55.wordWrap;
_58.color=objj_msgSend(_textShadowColor,"cssString");
_58.zIndex=150;
_58.textOverflow=_55.textOverflow;
if(document.attachEvent){
_58.overflow=_55.overflow;
}else{
_58.overflowX=_55.overflowX;
_58.overflowY=_55.overflowY;
}
_DOMElement.appendChild(_DOMTextShadowElement);
_57=YES;
_flags|=_3;
}
}
var _58=_57?_DOMTextShadowElement.style:nil;
if(_54){
if(_flags&_3){
if(CPFeatureIsCompatible(CPJavascriptInnerTextFeature)){
_DOMTextElement.innerText=_text;
if(_DOMTextShadowElement){
_DOMTextShadowElement.innerText=_text;
}
}else{
if(CPFeatureIsCompatible(CPJavascriptTextContentFeature)){
_DOMTextElement.textContent=_text;
if(_DOMTextShadowElement){
_DOMTextShadowElement.textContent=_text;
}
}
}
}
if(_flags&_8){
var _59=objj_msgSend(_font?_font:objj_msgSend(CPFont,"systemFontOfSize:",12),"cssString");
_55.font=_59;
if(_58){
_58.font=_59;
}
}
if(_flags&_6){
switch(_lineBreakMode){
case CPLineBreakByClipping:
_55.overflow="hidden";
_55.textOverflow="clip";
_55.whiteSpace="pre";
_55.wordWrap="normal";
break;
case CPLineBreakByTruncatingHead:
case CPLineBreakByTruncatingMiddle:
case CPLineBreakByTruncatingTail:
_55.textOverflow="ellipsis";
_55.whiteSpace="nowrap";
_55.overflow="hidden";
_55.wordWrap="normal";
break;
case CPLineBreakByCharWrapping:
case CPLineBreakByWordWrapping:
_55.wordWrap="break-word";
try{
_55.whiteSpace="pre";
_55.whiteSpace="-o-pre-wrap";
_55.whiteSpace="-pre-wrap";
_55.whiteSpace="-moz-pre-wrap";
_55.whiteSpace="pre-wrap";
}
catch(e){
_55.whiteSpace="pre";
}
_55.overflow="hidden";
_55.textOverflow="clip";
break;
}
if(_58){
if(document.attachEvent){
_58.overflow=_55.overflow;
}else{
_58.overflowX=_55.overflowX;
_58.overflowY=_55.overflowY;
}
_58.wordWrap=_55.wordWrap;
_58.whiteSpace=_55.whiteSpace;
_58.textOverflow=_55.textOverflow;
}
}
}
var _5a=_image!==nil&&_imagePosition!==CPNoImage,_5b=!!_DOMImageElement;
if(_5a!==_5b){
if(_5b){
_DOMElement.removeChild(_DOMImageElement);
_DOMImageElement=NULL;
_5b=NO;
}else{
_DOMImageElement=document.createElement("img");
if(objj_msgSend(CPPlatform,"supportsDragAndDrop")){
_DOMImageElement.setAttribute("draggable","true");
_DOMImageElement.style["-khtml-user-drag"]="element";
}
var _5c=_DOMImageElement.style;
_5c.top="0px";
_5c.left="0px";
_5c.position="absolute";
_5c.zIndex=100;
_DOMElement.appendChild(_DOMImageElement);
_5b=YES;
}
}
var _5d=objj_msgSend(_51,"bounds").size,_5e={origin:{x:0,y:0},size:{width:_5d.width,height:_5d.height}};
if(_5b){
if(!_5c){
var _5c=_DOMImageElement.style;
}
if(_flags&_2){
_DOMImageElement.src=objj_msgSend(_image,"filename");
}
var _5f=_5d.width/2,_60=_5d.height/2,_61=objj_msgSend(_image,"size"),_62=_61.width,_63=_61.height;
if(_imageScaling===CPScaleToFit){
_62=_5d.width;
_63=_5d.height;
}else{
if(_imageScaling===CPScaleProportionally){
var _64=MIN(MIN(_5d.width,_62)/_62,MIN(_5d.height,_63)/_63);
_62*=_64;
_63*=_64;
}
}
_DOMImageElement.width=_62;
_DOMImageElement.height=_63;
_5c.width=MAX(_62,0)+"px";
_5c.height=MAX(_63,0)+"px";
if(_imagePosition===CPImageBelow){
_5c.left=FLOOR(_5f-_62/2)+"px";
_5c.top=FLOOR(_5d.height-_63)+"px";
_5e.size.height=_5d.height-_63-_d;
}else{
if(_imagePosition===CPImageAbove){
if(NULL){
var _65=_CGPointApplyAffineTransform(CGPointMake(FLOOR(_5f-_62/2),0),NULL);
}else{
var _65={x:FLOOR(_5f-_62/2),y:0};
}
_DOMImageElement.style.left=ROUND(_65.x)+"px";
_DOMImageElement.style.top=ROUND(_65.y)+"px";
_5e.origin.y+=_63+_d;
_5e.size.height=_5d.height-_63-_d;
}else{
if(_imagePosition===CPImageLeft){
_5c.top=FLOOR(_60-_63/2)+"px";
_5c.left="0px";
_5e.origin.x=_62+_c;
_5e.size.width-=_62+_c;
}else{
if(_imagePosition===CPImageRight){
_5c.top=FLOOR(_60-_63/2)+"px";
_5c.left=FLOOR(_5d.width-_62)+"px";
_5e.size.width-=_62+_c;
}else{
if(_imagePosition===CPImageOnly){
_5c.top=FLOOR(_60-_63/2)+"px";
_5c.left=FLOOR(_5f-_62/2)+"px";
}
}
}
}
}
}
if(_54){
var _66=(_5e.origin.x),_67=(_5e.origin.y),_68=(_5e.size.width),_69=(_5e.size.height);
if(_verticalAlignment!==CPTopVerticalTextAlignment){
if(!_textSize){
if(_lineBreakMode===CPLineBreakByCharWrapping||_lineBreakMode===CPLineBreakByWordWrapping){
_textSize=objj_msgSend(_text,"sizeWithFont:inWidth:",_font,_68);
}else{
_textSize=objj_msgSend(_text,"sizeWithFont:",_font);
}
}
if(_verticalAlignment===CPCenterVerticalTextAlignment){
_67=_67+(_69-_textSize.height)/2;
_69=_textSize.height;
}else{
_67=_67+_69-_textSize.height;
_69=_textSize.height;
}
}
_55.top=ROUND(_67)+"px";
_55.left=ROUND(_66)+"px";
_55.width=MAX(ROUND(_68),0)+"px";
_55.height=MAX(ROUND(_69),0)+"px";
if(_58){
if(_flags&_9){
_58.color=objj_msgSend(_textShadowColor,"cssString");
}
_58.top=ROUND(_67+_textShadowOffset.height)+"px";
_58.left=ROUND(_66+_textShadowOffset.width)+"px";
_58.width=MAX(ROUND(_68),0)+"px";
_58.height=MAX(ROUND(_69),0)+"px";
}
}
_flags=0;
}
}),new objj_method(sel_getUid("sizeToFit"),function(_6a,_6b){
with(_6a){
var _6c=CGSizeMakeZero();
if((_imagePosition!==CPNoImage)&&_image){
var _6d=objj_msgSend(_image,"size");
_6c.width+=_6d.width;
_6c.height+=_6d.height;
}
if((_imagePosition!==CPImageOnly)&&objj_msgSend(_text,"length")>0){
if(!_textSize){
_textSize=objj_msgSend(_text,"sizeWithFont:",_font?_font:objj_msgSend(CPFont,"systemFontOfSize:",12));
}
if(_imagePosition===CPImageLeft||_imagePosition===CPImageRight){
_6c.width+=_textSize.width+_c;
_6c.height=MAX(_6c.height,_textSize.height);
}else{
if(_imagePosition===CPImageAbove||_imagePosition===CPImageBelow){
_6c.width=MAX(_6c.width,_textSize.width);
_6c.height+=_textSize.height+_d;
}else{
_6c.width=MAX(_6c.width,_textSize.width);
_6c.height=MAX(_6c.height,_textSize.height);
}
}
}
objj_msgSend(_6a,"setFrameSize:",_6c);
}
})]);
p;29;_CPToolbarFlexibleSpaceItem.jt;794;@STATIC;1.0;i;15;CPToolbarItem.jt;756;
objj_executeFile("CPToolbarItem.j",YES);
var _1=objj_allocateClassPair(CPToolbarItem,"_CPToolbarFlexibleSpaceItem"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithItemIdentifier:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("_CPToolbarFlexibleSpaceItem").super_class},"initWithItemIdentifier:",CPToolbarFlexibleSpaceItemIdentifier);
if(_3){
objj_msgSend(_3,"setMinSize:",CGSizeMake(32,32));
objj_msgSend(_3,"setMaxSize:",CGSizeMake(10000,32));
}
return _3;
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_6,_7,_8){
with(_6){
return objj_msgSend(_6,"init");
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_9,_a,_b){
with(_9){
}
})]);
p;25;_CPToolbarSeparatorItem.jt;780;@STATIC;1.0;i;15;CPToolbarItem.jt;742;
objj_executeFile("CPToolbarItem.j",YES);
var _1=objj_allocateClassPair(CPToolbarItem,"_CPToolbarSeparatorItem"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithItemIdentifier:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("_CPToolbarSeparatorItem").super_class},"initWithItemIdentifier:",CPToolbarSeparatorItemIdentifier);
if(_3){
objj_msgSend(_3,"setMinSize:",CGSizeMake(2,0));
objj_msgSend(_3,"setMaxSize:",CGSizeMake(2,100000));
}
return _3;
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_6,_7,_8){
with(_6){
return objj_msgSend(_6,"init");
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_9,_a,_b){
with(_9){
}
})]);
p;26;_CPToolbarShowColorsItem.jt;1230;@STATIC;1.0;i;15;CPToolbarItem.jt;1191;
objj_executeFile("CPToolbarItem.j",YES);
var _1=objj_allocateClassPair(CPToolbarItem,"_CPToolbarShowColorsItem"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithItemIdentifier:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("_CPToolbarShowColorsItem").super_class},"initWithItemIdentifier:",CPToolbarShowColorsItemIdentifier);
if(_3){
objj_msgSend(_3,"setMinSize:",CGSizeMake(32,32));
objj_msgSend(_3,"setMaxSize:",CGSizeMake(32,32));
objj_msgSend(_3,"setLabel:","Colors");
objj_msgSend(_3,"setPaletteLabel:","Show Colors");
objj_msgSend(_3,"setTarget:",CPApp);
objj_msgSend(_3,"setAction:",sel_getUid("orderFrontColorPanel:"));
objj_msgSend(_3,"setImage:",objj_msgSend(CPImage,"imageNamed:",CPImageNameColorPanel));
objj_msgSend(_3,"setAlternateImage:",objj_msgSend(CPImage,"imageNamed:",CPImageNameColorPanelHighlighted));
objj_msgSend(_3,"setToolTip:","Show the Colors panel.");
}
return _3;
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_6,_7,_8){
with(_6){
return objj_msgSend(_6,"init");
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_9,_a,_b){
with(_9){
}
})]);
p;21;_CPToolbarSpaceItem.jt;767;@STATIC;1.0;i;15;CPToolbarItem.jt;729;
objj_executeFile("CPToolbarItem.j",YES);
var _1=objj_allocateClassPair(CPToolbarItem,"_CPToolbarSpaceItem"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithItemIdentifier:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("_CPToolbarSpaceItem").super_class},"initWithItemIdentifier:",CPToolbarSpaceItemIdentifier);
if(_3){
objj_msgSend(_3,"setMinSize:",CGSizeMake(32,32));
objj_msgSend(_3,"setMaxSize:",CGSizeMake(32,32));
}
return _3;
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_6,_7,_8){
with(_6){
return objj_msgSend(_6,"init");
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_9,_a,_b){
with(_9){
}
})]);
p;8;AppKit.jt;3749;@STATIC;1.0;i;9;CALayer.ji;9;CPAlert.ji;13;CPAnimation.ji;15;CPApplication.ji;14;CPBezierPath.ji;7;CPBox.ji;10;CPButton.ji;13;CPButtonBar.ji;12;CPCheckBox.ji;7;CPCib.ji;16;CPCibConnector.ji;23;CPCibControlConnector.ji;14;CPCibLoading.ji;22;CPCibOutletConnector.ji;12;CPClipView.ji;22;CPCollectionViewItem.ji;18;CPCollectionView.ji;9;CPColor.ji;14;CPColorPanel.ji;13;CPColorWell.ji;17;CPCompatibility.ji;11;CPControl.ji;10;CPCookie.ji;10;CPCursor.ji;12;CPDocument.ji;22;CPDocumentController.ji;9;CPEvent.ji;14;CPFlashMovie.ji;13;CPFlashView.ji;8;CPFont.ji;15;CPFontManager.ji;12;CPGeometry.ji;9;CPImage.ji;13;CPImageView.ji;8;CPMenu.ji;12;CPMenuItem.ji;13;CPOpenPanel.ji;15;CPOutlineView.ji;9;CPPanel.ji;14;CPPasteboard.ji;15;CPPopUpButton.ji;21;CPProgressIndicator.ji;9;CPRadio.ji;13;CPResponder.ji;15;CPSearchField.ji;14;CPScrollView.ji;12;CPScroller.ji;19;CPSecureTextField.ji;20;CPSegmentedControl.ji;10;CPShadow.ji;10;CPSlider.ji;13;CPSplitView.ji;11;CPTabView.ji;15;CPTableColumn.ji;13;CPTableView.ji;13;CPTextField.ji;11;CPToolbar.ji;15;CPToolbarItem.ji;12;CPTreeNode.ji;8;CPView.ji;17;CPViewAnimation.ji;18;CPViewController.ji;11;CPWebView.ji;10;CPWindow.ji;20;CPWindowController.jt;2554;
objj_executeFile("CALayer.j",YES);
objj_executeFile("CPAlert.j",YES);
objj_executeFile("CPAnimation.j",YES);
objj_executeFile("CPApplication.j",YES);
objj_executeFile("CPBezierPath.j",YES);
objj_executeFile("CPBox.j",YES);
objj_executeFile("CPButton.j",YES);
objj_executeFile("CPButtonBar.j",YES);
objj_executeFile("CPCheckBox.j",YES);
objj_executeFile("CPCib.j",YES);
objj_executeFile("CPCibConnector.j",YES);
objj_executeFile("CPCibControlConnector.j",YES);
objj_executeFile("CPCibLoading.j",YES);
objj_executeFile("CPCibOutletConnector.j",YES);
objj_executeFile("CPClipView.j",YES);
objj_executeFile("CPCollectionViewItem.j",YES);
objj_executeFile("CPCollectionView.j",YES);
objj_executeFile("CPColor.j",YES);
objj_executeFile("CPColorPanel.j",YES);
objj_executeFile("CPColorWell.j",YES);
objj_executeFile("CPCompatibility.j",YES);
objj_executeFile("CPControl.j",YES);
objj_executeFile("CPCookie.j",YES);
objj_executeFile("CPCursor.j",YES);
objj_executeFile("CPDocument.j",YES);
objj_executeFile("CPDocumentController.j",YES);
objj_executeFile("CPEvent.j",YES);
objj_executeFile("CPFlashMovie.j",YES);
objj_executeFile("CPFlashView.j",YES);
objj_executeFile("CPFont.j",YES);
objj_executeFile("CPFontManager.j",YES);
objj_executeFile("CPGeometry.j",YES);
objj_executeFile("CPImage.j",YES);
objj_executeFile("CPImageView.j",YES);
objj_executeFile("CPMenu.j",YES);
objj_executeFile("CPMenuItem.j",YES);
objj_executeFile("CPOpenPanel.j",YES);
objj_executeFile("CPOutlineView.j",YES);
objj_executeFile("CPPanel.j",YES);
objj_executeFile("CPPasteboard.j",YES);
objj_executeFile("CPPopUpButton.j",YES);
objj_executeFile("CPProgressIndicator.j",YES);
objj_executeFile("CPRadio.j",YES);
objj_executeFile("CPResponder.j",YES);
objj_executeFile("CPSearchField.j",YES);
objj_executeFile("CPScrollView.j",YES);
objj_executeFile("CPScroller.j",YES);
objj_executeFile("CPSecureTextField.j",YES);
objj_executeFile("CPSegmentedControl.j",YES);
objj_executeFile("CPShadow.j",YES);
objj_executeFile("CPSlider.j",YES);
objj_executeFile("CPSplitView.j",YES);
objj_executeFile("CPTabView.j",YES);
objj_executeFile("CPTableColumn.j",YES);
objj_executeFile("CPTableView.j",YES);
objj_executeFile("CPTextField.j",YES);
objj_executeFile("CPToolbar.j",YES);
objj_executeFile("CPToolbarItem.j",YES);
objj_executeFile("CPTreeNode.j",YES);
objj_executeFile("CPView.j",YES);
objj_executeFile("CPViewAnimation.j",YES);
objj_executeFile("CPViewController.j",YES);
objj_executeFile("CPWebView.j",YES);
objj_executeFile("CPWindow.j",YES);
objj_executeFile("CPWindowController.j",YES);
p;17;CPAccordionView.jt;10946;@STATIC;1.0;I;20;Foundation/CPArray.jI;21;Foundation/CPObject.jI;32;Foundation/CPKeyValueObserving.jI;23;Foundation/CPIndexSet.jI;21;Foundation/CPString.jI;15;AppKit/CPView.jt;10764;
objj_executeFile("Foundation/CPArray.j",NO);
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("Foundation/CPKeyValueObserving.j",NO);
objj_executeFile("Foundation/CPIndexSet.j",NO);
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("AppKit/CPView.j",NO);
var _1=objj_allocateClassPair(CPObject,"CPAccordionViewItem"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_identifier"),new objj_ivar("_view"),new objj_ivar("_label")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("identifier"),function(_3,_4){
with(_3){
return _identifier;
}
}),new objj_method(sel_getUid("setIdentifier:"),function(_5,_6,_7){
with(_5){
_identifier=_7;
}
}),new objj_method(sel_getUid("view"),function(_8,_9){
with(_8){
return _view;
}
}),new objj_method(sel_getUid("setView:"),function(_a,_b,_c){
with(_a){
_view=_c;
}
}),new objj_method(sel_getUid("label"),function(_d,_e){
with(_d){
return _label;
}
}),new objj_method(sel_getUid("setLabel:"),function(_f,_10,_11){
with(_f){
_label=_11;
}
}),new objj_method(sel_getUid("init"),function(_12,_13){
with(_12){
return objj_msgSend(_12,"initWithIdentifier:","");
}
}),new objj_method(sel_getUid("initWithIdentifier:"),function(_14,_15,_16){
with(_14){
_14=objj_msgSendSuper({receiver:_14,super_class:objj_getClass("CPAccordionViewItem").super_class},"init");
if(_14){
objj_msgSend(_14,"setIdentifier:",_16);
}
return _14;
}
})]);
var _1=objj_allocateClassPair(CPView,"CPAccordionView"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_dirtyItemIndex"),new objj_ivar("_itemHeaderPrototype"),new objj_ivar("_items"),new objj_ivar("_itemViews"),new objj_ivar("_expandedItemIndexes")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithFrame:"),function(_17,_18,_19){
with(_17){
_17=objj_msgSendSuper({receiver:_17,super_class:objj_getClass("CPAccordionView").super_class},"initWithFrame:",_19);
if(_17){
_items=[];
_itemViews=[];
_expandedItemIndexes=objj_msgSend(CPIndexSet,"indexSet");
objj_msgSend(_17,"setItemHeaderPrototype:",objj_msgSend(objj_msgSend(CPButton,"alloc"),"initWithFrame:",{origin:{x:0,y:0},size:{width:100,height:24}}));
}
return _17;
}
}),new objj_method(sel_getUid("setItemHeaderPrototype:"),function(_1a,_1b,_1c){
with(_1a){
_itemHeaderPrototype=_1c;
}
}),new objj_method(sel_getUid("itemHeaderPrototype"),function(_1d,_1e){
with(_1d){
return _itemHeaderPrototype;
}
}),new objj_method(sel_getUid("items"),function(_1f,_20){
with(_1f){
return _items;
}
}),new objj_method(sel_getUid("addItem:"),function(_21,_22,_23){
with(_21){
objj_msgSend(_21,"insertItem:atIndex:",_23,_items.length);
}
}),new objj_method(sel_getUid("insertItem:atIndex:"),function(_24,_25,_26,_27){
with(_24){
objj_msgSend(_expandedItemIndexes,"addIndex:",_27);
var _28=objj_msgSend(objj_msgSend(_CPAccordionItemView,"alloc"),"initWithAccordionView:",_24);
objj_msgSend(_28,"setIndex:",_27);
objj_msgSend(_28,"setLabel:",objj_msgSend(_26,"label"));
objj_msgSend(_28,"setContentView:",objj_msgSend(_26,"view"));
objj_msgSend(_24,"addSubview:",_28);
objj_msgSend(_items,"insertObject:atIndex:",_26,_27);
objj_msgSend(_itemViews,"insertObject:atIndex:",_28,_27);
objj_msgSend(_24,"_invalidateItemsStartingAtIndex:",_27);
objj_msgSend(_24,"setNeedsLayout");
}
}),new objj_method(sel_getUid("removeItem:"),function(_29,_2a,_2b){
with(_29){
objj_msgSend(_29,"removeItemAtIndex:",objj_msgSend(_items,"indexOfObjectIdenticalTo:",_2b));
}
}),new objj_method(sel_getUid("removeItemAtIndex:"),function(_2c,_2d,_2e){
with(_2c){
objj_msgSend(_expandedItemIndexes,"removeIndex:",_2e);
objj_msgSend(_itemViews[_2e],"removeFromSuperview");
objj_msgSend(_items,"removeObjectAtIndex:",_2e);
objj_msgSend(_itemViews,"removeObjectAtIndex:",_2e);
objj_msgSend(_2c,"_invalidateItemsStartingAtIndex:",_2e);
objj_msgSend(_2c,"setNeedsLayout");
}
}),new objj_method(sel_getUid("removeAllItems"),function(_2f,_30){
with(_2f){
var _31=_items.length;
while(_31--){
objj_msgSend(_2f,"removeItemAtIndex:",_31);
}
}
}),new objj_method(sel_getUid("expandItemAtIndex:"),function(_32,_33,_34){
with(_32){
if(!objj_msgSend(_itemViews[_34],"isCollapsed")){
return;
}
objj_msgSend(_expandedItemIndexes,"addIndex:",_34);
objj_msgSend(_itemViews[_34],"setCollapsed:",NO);
objj_msgSend(_32,"_invalidateItemsStartingAtIndex:",_34);
}
}),new objj_method(sel_getUid("collapseItemAtIndex:"),function(_35,_36,_37){
with(_35){
if(objj_msgSend(_itemViews[_37],"isCollapsed")){
return;
}
objj_msgSend(_expandedItemIndexes,"removeIndex:",_37);
objj_msgSend(_itemViews[_37],"setCollapsed:",YES);
objj_msgSend(_35,"_invalidateItemsStartingAtIndex:",_37);
}
}),new objj_method(sel_getUid("toggleItemAtIndex:"),function(_38,_39,_3a){
with(_38){
var _3b=_itemViews[_3a];
if(objj_msgSend(_3b,"isCollapsed")){
objj_msgSend(_38,"expandItemAtIndex:",_3a);
}else{
objj_msgSend(_38,"collapseItemAtIndex:",_3a);
}
}
}),new objj_method(sel_getUid("expandedItemIndexes"),function(_3c,_3d){
with(_3c){
return _expandedItemIndexes;
}
}),new objj_method(sel_getUid("collapsedItemIndexes"),function(_3e,_3f){
with(_3e){
var _40=objj_msgSend(CPIndexSet,"indexSetWithIndexesInRange:",CPMakeRange(0,_items.length));
objj_msgSend(_40,"removeIndexes:",_expandedIndexes);
return _40;
}
}),new objj_method(sel_getUid("setEnabled:forItemAtIndex:"),function(_41,_42,_43,_44){
with(_41){
var _45=_itemViews[_44];
if(!_45){
return;
}
if(!_43){
objj_msgSend(_41,"collapseItemAtIndex:",_44);
}else{
objj_msgSend(_41,"expandItemAtIndex:",_44);
}
objj_msgSend(_45,"setEnabled:",_43);
}
}),new objj_method(sel_getUid("_invalidateItemsStartingAtIndex:"),function(_46,_47,_48){
with(_46){
if(_dirtyItemIndex===CPNotFound){
_dirtyItemIndex=_48;
}
_dirtyItemIndex=MIN(_dirtyItemIndex,_48);
objj_msgSend(_46,"setNeedsLayout");
}
}),new objj_method(sel_getUid("setFrameSize:"),function(_49,_4a,_4b){
with(_49){
var _4c=(objj_msgSend(_49,"frame").size.width);
objj_msgSendSuper({receiver:_49,super_class:objj_getClass("CPAccordionView").super_class},"setFrameSize:",_4b);
if(_4c!==(objj_msgSend(_49,"frame").size.width)){
objj_msgSend(_49,"_invalidateItemsStartingAtIndex:",0);
}
}
}),new objj_method(sel_getUid("layoutSubviews"),function(_4d,_4e){
with(_4d){
if(_items.length<=0){
return objj_msgSend(_4d,"setFrameSize:",{width:(objj_msgSend(_4d,"frame").size.width),height:0});
}
if(_dirtyItemIndex===CPNotFound){
return;
}
_dirtyItemIndex=MIN(_dirtyItemIndex,_items.length-1);
var _4f=_dirtyItemIndex,_50=_itemViews.length,_51=(objj_msgSend(_4d,"bounds").size.width),y=_4f>0?CGRectGetMaxY(objj_msgSend(_itemViews[_4f-1],"frame")):0;
_dirtyItemIndex=CPNotFound;
for(;_4f<_50;++_4f){
var _52=_itemViews[_4f];
objj_msgSend(_52,"setFrameY:width:",y,_51);
y=CGRectGetMaxY(objj_msgSend(_52,"frame"));
}
objj_msgSend(_4d,"setFrameSize:",{width:(objj_msgSend(_4d,"frame").size.width),height:y});
}
})]);
var _1=objj_allocateClassPair(CPView,"_CPAccordionItemView"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_accordionView"),new objj_ivar("_isCollapsed"),new objj_ivar("_index"),new objj_ivar("_headerView"),new objj_ivar("_contentView")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("isCollapsed"),function(_53,_54){
with(_53){
return _isCollapsed;
}
}),new objj_method(sel_getUid("setCollapsed:"),function(_55,_56,_57){
with(_55){
_isCollapsed=_57;
}
}),new objj_method(sel_getUid("index"),function(_58,_59){
with(_58){
return _index;
}
}),new objj_method(sel_getUid("setIndex:"),function(_5a,_5b,_5c){
with(_5a){
_index=_5c;
}
}),new objj_method(sel_getUid("initWithAccordionView:"),function(_5d,_5e,_5f){
with(_5d){
_5d=objj_msgSendSuper({receiver:_5d,super_class:objj_getClass("_CPAccordionItemView").super_class},"initWithFrame:",{origin:{x:0,y:0},size:{width:0,height:0}});
if(_5d){
_accordionView=_5f;
_isCollapsed=NO;
var _60=objj_msgSend(_5d,"bounds");
_headerView=objj_msgSend(CPKeyedUnarchiver,"unarchiveObjectWithData:",objj_msgSend(CPKeyedArchiver,"archivedDataWithRootObject:",objj_msgSend(_accordionView,"itemHeaderPrototype")));
if(objj_msgSend(_headerView,"respondsToSelector:",sel_getUid("setTarget:"))&&objj_msgSend(_headerView,"respondsToSelector:",sel_getUid("setAction:"))){
objj_msgSend(_headerView,"setTarget:",_5d);
objj_msgSend(_headerView,"setAction:",sel_getUid("toggle:"));
}
objj_msgSend(_5d,"addSubview:",_headerView);
}
return _5d;
}
}),new objj_method(sel_getUid("toggle:"),function(_61,_62,_63){
with(_61){
objj_msgSend(_accordionView,"toggleItemAtIndex:",objj_msgSend(_61,"index"));
}
}),new objj_method(sel_getUid("setLabel:"),function(_64,_65,_66){
with(_64){
if(objj_msgSend(_headerView,"respondsToSelector:",sel_getUid("setTitle:"))){
objj_msgSend(_headerView,"setTitle:",_66);
}else{
if(objj_msgSend(_headerView,"respondsToSelector:",sel_getUid("setLabel:"))){
objj_msgSend(_headerView,"setLabel:",_66);
}else{
if(objj_msgSend(_headerView,"respondsToSelector:",sel_getUid("setStringValue:"))){
objj_msgSend(_headerView,"setStringValue:",_66);
}
}
}
}
}),new objj_method(sel_getUid("setEnabled:"),function(_67,_68,_69){
with(_67){
if(objj_msgSend(_headerView,"respondsToSelector:",sel_getUid("setEnabled:"))){
objj_msgSend(_headerView,"setEnabled:",_69);
}
}
}),new objj_method(sel_getUid("setContentView:"),function(_6a,_6b,_6c){
with(_6a){
if(_contentView===_6c){
return;
}
objj_msgSend(_contentView,"removeObserver:forKeyPath:",_6a,"frame");
objj_msgSend(_contentView,"removeFromSuperview");
_contentView=_6c;
objj_msgSend(_contentView,"addObserver:forKeyPath:options:context:",_6a,"frame",CPKeyValueObservingOptionOld|CPKeyValueObservingOptionNew,NULL);
objj_msgSend(_6a,"addSubview:",_contentView);
objj_msgSend(_accordionView,"_invalidateItemsStartingAtIndex:",objj_msgSend(_6a,"index"));
}
}),new objj_method(sel_getUid("setFrameY:width:"),function(_6d,_6e,aY,_6f){
with(_6d){
var _70=(objj_msgSend(_headerView,"frame").size.height);
objj_msgSend(_headerView,"setFrameSize:",{width:_6f,height:_70});
objj_msgSend(_contentView,"setFrameOrigin:",{x:0,y:_70});
if(objj_msgSend(_6d,"isCollapsed")){
objj_msgSend(_6d,"setFrame:",{origin:{x:0,y:aY},size:{width:_6f,height:_70}});
}else{
var _71=(objj_msgSend(_contentView,"frame").size.height);
objj_msgSend(_contentView,"setFrameSize:",{width:_6f,height:_71});
objj_msgSend(_6d,"setFrame:",{origin:{x:0,y:aY},size:{width:_6f,height:_71+_70}});
}
}
}),new objj_method(sel_getUid("resizeSubviewsWithOldSize:"),function(_72,_73,_74){
with(_72){
}
}),new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"),function(_75,_76,_77,_78,_79,_7a){
with(_75){
if(_77==="frame"&&!CGRectEqualToRect(objj_msgSend(_79,"objectForKey:",CPKeyValueChangeOldKey),objj_msgSend(_79,"objectForKey:",CPKeyValueChangeNewKey))){
objj_msgSend(_accordionView,"_invalidateItemsStartingAtIndex:",objj_msgSend(_75,"index"));
}
}
})]);
p;9;CPAlert.jt;6678;@STATIC;1.0;I;21;Foundation/CPObject.jI;21;Foundation/CPString.jI;22;AppKit/CPApplication.jI;17;AppKit/CPButton.jI;16;AppKit/CPColor.jI;15;AppKit/CPFont.jI;16;AppKit/CPImage.jI;20;AppKit/CPImageView.jI;16;AppKit/CPPanel.jI;20;AppKit/CPTextField.jt;6425;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("AppKit/CPApplication.j",NO);
objj_executeFile("AppKit/CPButton.j",NO);
objj_executeFile("AppKit/CPColor.j",NO);
objj_executeFile("AppKit/CPFont.j",NO);
objj_executeFile("AppKit/CPImage.j",NO);
objj_executeFile("AppKit/CPImageView.j",NO);
objj_executeFile("AppKit/CPPanel.j",NO);
objj_executeFile("AppKit/CPTextField.j",NO);
CPWarningAlertStyle=0;
CPInformationalAlertStyle=1;
CPCriticalAlertStyle=2;
var _1,_2,_3;
var _4=objj_allocateClassPair(CPObject,"CPAlert"),_5=_4.isa;
class_addIvars(_4,[new objj_ivar("_alertPanel"),new objj_ivar("_messageLabel"),new objj_ivar("_alertImageView"),new objj_ivar("_alertStyle"),new objj_ivar("_windowTitle"),new objj_ivar("_windowStyle"),new objj_ivar("_buttonCount"),new objj_ivar("_buttons"),new objj_ivar("_delegate")]);
objj_registerClassPair(_4);
class_addMethods(_4,[new objj_method(sel_getUid("init"),function(_6,_7){
with(_6){
if(_6=objj_msgSendSuper({receiver:_6,super_class:objj_getClass("CPAlert").super_class},"init")){
_buttonCount=0;
_buttons=objj_msgSend(CPArray,"array");
_alertStyle=CPWarningAlertStyle;
objj_msgSend(_6,"setWindowStyle:",nil);
}
return _6;
}
}),new objj_method(sel_getUid("setWindowStyle:"),function(_8,_9,_a){
with(_8){
_windowStyle=_a;
_alertPanel=objj_msgSend(objj_msgSend(CPPanel,"alloc"),"initWithContentRect:styleMask:",CGRectMake(0,0,400,110),_a?_a|CPTitledWindowMask:CPTitledWindowMask);
objj_msgSend(_alertPanel,"setFloatingPanel:",YES);
objj_msgSend(_alertPanel,"center");
objj_msgSend(_messageLabel,"setTextColor:",(_a&CPHUDBackgroundWindowMask)?objj_msgSend(CPColor,"whiteColor"):objj_msgSend(CPColor,"blackColor"));
var _b=objj_msgSend(_buttons,"count");
for(var i=0;i<_b;i++){
var _c=_buttons[i];
objj_msgSend(_c,"setFrameSize:",CGSizeMake(objj_msgSend(_c,"frame").size.width,(_a==CPHUDBackgroundWindowMask)?20:24));
objj_msgSend(_c,"setTheme:",(_windowStyle===CPHUDBackgroundWindowMask)?objj_msgSend(CPTheme,"themeNamed:","Aristo-HUD"):objj_msgSend(CPTheme,"defaultTheme"));
objj_msgSend(objj_msgSend(_alertPanel,"contentView"),"addSubview:",_c);
}
if(!_messageLabel){
var _d=objj_msgSend(objj_msgSend(_alertPanel,"contentView"),"bounds");
_messageLabel=objj_msgSend(objj_msgSend(CPTextField,"alloc"),"initWithFrame:",CGRectMake(57,10,CGRectGetWidth(_d)-73,62));
objj_msgSend(_messageLabel,"setFont:",objj_msgSend(CPFont,"boldSystemFontOfSize:",13));
objj_msgSend(_messageLabel,"setLineBreakMode:",CPLineBreakByWordWrapping);
objj_msgSend(_messageLabel,"setAlignment:",CPJustifiedTextAlignment);
objj_msgSend(_messageLabel,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
_alertImageView=objj_msgSend(objj_msgSend(CPImageView,"alloc"),"initWithFrame:",CGRectMake(15,12,32,32));
}
objj_msgSend(objj_msgSend(_alertPanel,"contentView"),"addSubview:",_messageLabel);
objj_msgSend(objj_msgSend(_alertPanel,"contentView"),"addSubview:",_alertImageView);
}
}),new objj_method(sel_getUid("setTitle:"),function(_e,_f,_10){
with(_e){
_windowTitle=_10;
}
}),new objj_method(sel_getUid("title"),function(_11,_12){
with(_11){
return _windowTitle;
}
}),new objj_method(sel_getUid("windowStyle"),function(_13,_14){
with(_13){
return _windowStyle;
}
}),new objj_method(sel_getUid("setDelegate:"),function(_15,_16,_17){
with(_15){
_delegate=_17;
}
}),new objj_method(sel_getUid("delegate"),function(_18,_19){
with(_18){
return _delegate;
}
}),new objj_method(sel_getUid("setAlertStyle:"),function(_1a,_1b,_1c){
with(_1a){
_alertStyle=_1c;
}
}),new objj_method(sel_getUid("alertStyle"),function(_1d,_1e){
with(_1d){
return _alertStyle;
}
}),new objj_method(sel_getUid("setMessageText:"),function(_1f,_20,_21){
with(_1f){
objj_msgSend(_messageLabel,"setStringValue:",_21);
}
}),new objj_method(sel_getUid("messageText"),function(_22,_23){
with(_22){
return objj_msgSend(_messageLabel,"stringValue");
}
}),new objj_method(sel_getUid("addButtonWithTitle:"),function(_24,_25,_26){
with(_24){
var _27=objj_msgSend(objj_msgSend(_alertPanel,"contentView"),"bounds"),_28=objj_msgSend(objj_msgSend(CPButton,"alloc"),"initWithFrame:",CGRectMake(CGRectGetWidth(_27)-((_buttonCount+1)*90),CGRectGetHeight(_27)-34,80,(_windowStyle==CPHUDBackgroundWindowMask)?20:24));
objj_msgSend(_28,"setTitle:",_26);
objj_msgSend(_28,"setTarget:",_24);
objj_msgSend(_28,"setTag:",_buttonCount);
objj_msgSend(_28,"setAction:",sel_getUid("_notifyDelegate:"));
objj_msgSend(_28,"setTheme:",(_windowStyle===CPHUDBackgroundWindowMask)?objj_msgSend(CPTheme,"themeNamed:","Aristo-HUD"):objj_msgSend(CPTheme,"defaultTheme"));
objj_msgSend(_28,"setAutoresizingMask:",CPViewMinXMargin|CPViewMinYMargin);
objj_msgSend(objj_msgSend(_alertPanel,"contentView"),"addSubview:",_28);
if(_buttonCount==0){
objj_msgSend(_alertPanel,"setDefaultButton:",_28);
}
_buttonCount++;
objj_msgSend(_buttons,"addObject:",_28);
}
}),new objj_method(sel_getUid("runModal"),function(_29,_2a){
with(_29){
var _2b;
switch(_alertStyle){
case CPWarningAlertStyle:
objj_msgSend(_alertImageView,"setImage:",_1);
_2b="Warning";
break;
case CPInformationalAlertStyle:
objj_msgSend(_alertImageView,"setImage:",_2);
_2b="Information";
break;
case CPCriticalAlertStyle:
objj_msgSend(_alertImageView,"setImage:",_3);
_2b="Error";
break;
}
objj_msgSend(_alertPanel,"setTitle:",_windowTitle?_windowTitle:_2b);
objj_msgSend(CPApp,"runModalForWindow:",_alertPanel);
}
}),new objj_method(sel_getUid("_notifyDelegate:"),function(_2c,_2d,_2e){
with(_2c){
objj_msgSend(CPApp,"abortModal");
objj_msgSend(_alertPanel,"close");
if(_delegate&&objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("alertDidEnd:returnCode:"))){
objj_msgSend(_delegate,"alertDidEnd:returnCode:",_2c,objj_msgSend(_2e,"tag"));
}
}
})]);
class_addMethods(_5,[new objj_method(sel_getUid("initialize"),function(_2f,_30){
with(_2f){
if(_2f!=CPAlert){
return;
}
var _31=objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(_2f,"class"));
_1=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_31,"pathForResource:","CPAlert/dialog-warning.png"),CGSizeMake(32,32));
_2=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_31,"pathForResource:","CPAlert/dialog-information.png"),CGSizeMake(32,32));
_3=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_31,"pathForResource:","CPAlert/dialog-error.png"),CGSizeMake(32,32));
}
})]);
p;13;CPAnimation.jt;5490;@STATIC;1.0;I;21;Foundation/CPObject.ji;23;CAMediaTimingFunction.jt;5417;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("CAMediaTimingFunction.j",YES);
CPAnimationEaseInOut=0;
CPAnimationEaseIn=1;
CPAnimationEaseOut=2;
CPAnimationLinear=3;
ACTUAL_FRAME_RATE=0;
var _1=objj_allocateClassPair(CPObject,"CPAnimation"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_lastTime"),new objj_ivar("_duration"),new objj_ivar("_animationCurve"),new objj_ivar("_timingFunction"),new objj_ivar("_frameRate"),new objj_ivar("_progress"),new objj_ivar("_delegate"),new objj_ivar("_timer")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithDuration:animationCurve:"),function(_3,_4,_5,_6){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPAnimation").super_class},"init");
if(_3){
_progress=0;
_duration=MAX(0,_5);
_frameRate=60;
objj_msgSend(_3,"setAnimationCurve:",_6);
}
return _3;
}
}),new objj_method(sel_getUid("setAnimationCurve:"),function(_7,_8,_9){
with(_7){
switch(_9){
case CPAnimationEaseInOut:
timingFunctionName=kCAMediaTimingFunctionEaseInEaseOut;
break;
case CPAnimationEaseIn:
timingFunctionName=kCAMediaTimingFunctionEaseIn;
break;
case CPAnimationEaseOut:
timingFunctionName=kCAMediaTimingFunctionEaseOut;
break;
case CPAnimationLinear:
timingFunctionName=kCAMediaTimingFunctionLinear;
break;
default:
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Invalid value provided for animation curve");
break;
}
_animationCurve=_9;
_timingFunction=objj_msgSend(CAMediaTimingFunction,"functionWithName:",timingFunctionName);
}
}),new objj_method(sel_getUid("animationCurve"),function(_a,_b){
with(_a){
return _animationCurve;
}
}),new objj_method(sel_getUid("setDuration:"),function(_c,_d,_e){
with(_c){
if(_e<0){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"aDuration can't be negative");
}
_duration=_e;
}
}),new objj_method(sel_getUid("duration"),function(_f,_10){
with(_f){
return _duration;
}
}),new objj_method(sel_getUid("setFrameRate:"),function(_11,_12,_13){
with(_11){
if(_13<0){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"frameRate can't be negative");
}
_frameRate=_13;
}
}),new objj_method(sel_getUid("frameRate"),function(_14,_15){
with(_14){
return _frameRate;
}
}),new objj_method(sel_getUid("delegate"),function(_16,_17){
with(_16){
return _delegate;
}
}),new objj_method(sel_getUid("setDelegate:"),function(_18,_19,_1a){
with(_18){
_delegate=_1a;
}
}),new objj_method(sel_getUid("startAnimation"),function(_1b,_1c){
with(_1b){
if(_timer||_delegate&&objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("animationShouldStart:"))&&!objj_msgSend(_delegate,"animationShouldStart:",_1b)){
return;
}
if(_progress===1){
_progress=0;
}
ACTUAL_FRAME_RATE=0;
_lastTime=new Date();
_timer=objj_msgSend(CPTimer,"scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:",0,_1b,sel_getUid("animationTimerDidFire:"),nil,YES);
}
}),new objj_method(sel_getUid("animationTimerDidFire:"),function(_1d,_1e,_1f){
with(_1d){
var _20=new Date(),_21=MIN(1,objj_msgSend(_1d,"currentProgress")+(_20-_lastTime)/(_duration*1000));
_lastTime=_20;
++ACTUAL_FRAME_RATE;
objj_msgSend(_1d,"setCurrentProgress:",_21);
if(_21===1){
objj_msgSend(_timer,"invalidate");
_timer=nil;
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("animationDidEnd:"))){
objj_msgSend(_delegate,"animationDidEnd:",_1d);
}
}
}
}),new objj_method(sel_getUid("stopAnimation"),function(_22,_23){
with(_22){
if(!_timer){
return;
}
objj_msgSend(_timer,"invalidate");
_timer=nil;
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("animationDidStop:"))){
objj_msgSend(_delegate,"animationDidStop:",_22);
}
}
}),new objj_method(sel_getUid("isAnimating"),function(_24,_25){
with(_24){
return _timer;
}
}),new objj_method(sel_getUid("setCurrentProgress:"),function(_26,_27,_28){
with(_26){
_progress=_28;
}
}),new objj_method(sel_getUid("currentProgress"),function(_29,_2a){
with(_29){
return _progress;
}
}),new objj_method(sel_getUid("currentValue"),function(_2b,_2c){
with(_2b){
var t=objj_msgSend(_2b,"currentProgress");
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("animation:valueForProgress:"))){
return objj_msgSend(_delegate,"animation:valueForProgress:",_2b,t);
}
var c1=[],c2=[];
objj_msgSend(_timingFunction,"getControlPointAtIndex:values:",1,c1);
objj_msgSend(_timingFunction,"getControlPointAtIndex:values:",2,c2);
return _2d(t,c1[0],c1[1],c2[0],c2[1],_duration);
}
})]);
var _2d=_2d=function(t,p1x,p1y,p2x,p2y,_2e){
var ax=0,bx=0,cx=0,ay=0,by=0,cy=0;
sampleCurveX=function(t){
return ((ax*t+bx)*t+cx)*t;
};
sampleCurveY=function(t){
return ((ay*t+by)*t+cy)*t;
};
sampleCurveDerivativeX=function(t){
return (3*ax*t+2*bx)*t+cx;
};
solveEpsilon=function(_2f){
return 1/(200*_2f);
};
solve=function(x,_30){
return sampleCurveY(solveCurveX(x,_30));
};
solveCurveX=function(x,_31){
var t0,t1,t2,x2,d2,i;
fabs=function(n){
if(n>=0){
return n;
}else{
return 0-n;
}
};
for(t2=x,i=0;i<8;i++){
x2=sampleCurveX(t2)-x;
if(fabs(x2)<_31){
return t2;
}
d2=sampleCurveDerivativeX(t2);
if(fabs(d2)<0.000001){
break;
}
t2=t2-x2/d2;
}
t0=0;
t1=1;
t2=x;
if(t2<t0){
return t0;
}
if(t2>t1){
return t1;
}
while(t0<t1){
x2=sampleCurveX(t2);
if(fabs(x2-x)<_31){
return t2;
}
if(x>x2){
t0=t2;
}else{
t1=t2;
}
t2=(t1-t0)*0.5+t0;
}
return t2;
};
cx=3*p1x;
bx=3*(p2x-p1x)-cx;
ax=1-cx-bx;
cy=3*p1y;
by=3*(p2y-p1y)-cy;
ay=1-cy-by;
return solve(t,solveEpsilon(_2e));
};
p;15;CPApplication.jt;29641;@STATIC;1.0;I;21;Foundation/CPBundle.ji;17;CPCompatibility.ji;9;CPEvent.ji;8;CPMenu.ji;13;CPResponder.ji;22;CPDocumentController.ji;14;CPThemeBlend.ji;14;CPCibLoading.ji;12;CPPlatform.jt;29448;
objj_executeFile("Foundation/CPBundle.j",NO);
objj_executeFile("CPCompatibility.j",YES);
objj_executeFile("CPEvent.j",YES);
objj_executeFile("CPMenu.j",YES);
objj_executeFile("CPResponder.j",YES);
objj_executeFile("CPDocumentController.j",YES);
objj_executeFile("CPThemeBlend.j",YES);
objj_executeFile("CPCibLoading.j",YES);
objj_executeFile("CPPlatform.j",YES);
var _1="CPMainCibFile",_2="Main cib file base name";
CPApp=nil;
CPApplicationWillFinishLaunchingNotification="CPApplicationWillFinishLaunchingNotification";
CPApplicationDidFinishLaunchingNotification="CPApplicationDidFinishLaunchingNotification";
CPApplicationWillTerminateNotification="CPApplicationWillTerminateNotification";
CPApplicationWillBecomeActiveNotification="CPApplicationWillBecomeActiveNotification";
CPApplicationDidBecomeActiveNotification="CPApplicationDidBecomeActiveNotification";
CPApplicationWillResignActiveNotification="CPApplicationWillResignActiveNotification";
CPApplicationDidResignActiveNotification="CPApplicationDidResignActiveNotification";
CPTerminateNow=YES;
CPTerminateCancel=NO;
CPTerminateLater=-1;
CPRunStoppedResponse=-1000;
CPRunAbortedResponse=-1001;
CPRunContinuesResponse=-1002;
var _3=objj_allocateClassPair(CPResponder,"CPApplication"),_4=_3.isa;
class_addIvars(_3,[new objj_ivar("_eventListeners"),new objj_ivar("_currentEvent"),new objj_ivar("_windows"),new objj_ivar("_keyWindow"),new objj_ivar("_mainWindow"),new objj_ivar("_previousKeyWindow"),new objj_ivar("_previousMainWindow"),new objj_ivar("_mainMenu"),new objj_ivar("_documentController"),new objj_ivar("_currentSession"),new objj_ivar("_delegate"),new objj_ivar("_finishedLaunching"),new objj_ivar("_isActive"),new objj_ivar("_namedArgs"),new objj_ivar("_args"),new objj_ivar("_fullArgsString"),new objj_ivar("_applicationIconImage"),new objj_ivar("_aboutPanel")]);
objj_registerClassPair(_3);
class_addMethods(_3,[new objj_method(sel_getUid("init"),function(_5,_6){
with(_5){
_5=objj_msgSendSuper({receiver:_5,super_class:objj_getClass("CPApplication").super_class},"init");
if(_5){
_eventListeners=[];
_windows=[];
objj_msgSend(_windows,"addObject:",nil);
_mainMenu=objj_msgSend(objj_msgSend(CPMenu,"alloc"),"initWithTitle:","MainMenu");
objj_msgSend(_mainMenu,"setAutoenablesItems:",NO);
var _7=objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(CPApplication,"class")),_8=objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","New",sel_getUid("newDocument:"),"N");
objj_msgSend(_8,"setImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_7,"pathForResource:","CPApplication/New.png"),CGSizeMake(16,16)));
objj_msgSend(_8,"setAlternateImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_7,"pathForResource:","CPApplication/NewHighlighted.png"),CGSizeMake(16,16)));
objj_msgSend(_mainMenu,"addItem:",_8);
var _9=objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Open",sel_getUid("openDocument:"),"O");
objj_msgSend(_9,"setImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_7,"pathForResource:","CPApplication/Open.png"),CGSizeMake(16,16)));
objj_msgSend(_9,"setAlternateImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_7,"pathForResource:","CPApplication/OpenHighlighted.png"),CGSizeMake(16,16)));
objj_msgSend(_mainMenu,"addItem:",_9);
var _a=objj_msgSend(objj_msgSend(CPMenu,"alloc"),"initWithTitle:","Save"),_b=objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Save",sel_getUid("saveDocument:"),nil);
objj_msgSend(_b,"setImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_7,"pathForResource:","CPApplication/Save.png"),CGSizeMake(16,16)));
objj_msgSend(_b,"setAlternateImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_7,"pathForResource:","CPApplication/SaveHighlighted.png"),CGSizeMake(16,16)));
objj_msgSend(_a,"addItem:",objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Save",sel_getUid("saveDocument:"),"S"));
objj_msgSend(_a,"addItem:",objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Save As",sel_getUid("saveDocumentAs:"),nil));
objj_msgSend(_b,"setSubmenu:",_a);
objj_msgSend(_mainMenu,"addItem:",_b);
var _c=objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Edit",nil,nil),_d=objj_msgSend(objj_msgSend(CPMenu,"alloc"),"initWithTitle:","Edit"),_e=objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Undo",sel_getUid("undo:"),CPUndoKeyEquivalent),_f=objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Redo",sel_getUid("redo:"),CPRedoKeyEquivalent);
objj_msgSend(_e,"setKeyEquivalentModifierMask:",CPUndoKeyEquivalentModifierMask);
objj_msgSend(_f,"setKeyEquivalentModifierMask:",CPRedoKeyEquivalentModifierMask);
objj_msgSend(_d,"addItem:",_e);
objj_msgSend(_d,"addItem:",_f);
objj_msgSend(_d,"addItem:",objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Cut",sel_getUid("cut:"),"X")),objj_msgSend(_d,"addItem:",objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Copy",sel_getUid("copy:"),"C")),objj_msgSend(_d,"addItem:",objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Paste",sel_getUid("paste:"),"V"));
objj_msgSend(_c,"setSubmenu:",_d);
objj_msgSend(_c,"setHidden:",YES);
objj_msgSend(_mainMenu,"addItem:",_c);
objj_msgSend(_mainMenu,"addItem:",objj_msgSend(CPMenuItem,"separatorItem"));
}
return _5;
}
}),new objj_method(sel_getUid("setDelegate:"),function(_10,_11,_12){
with(_10){
if(_delegate==_12){
return;
}
var _13=objj_msgSend(CPNotificationCenter,"defaultCenter");
if(_delegate){
objj_msgSend(_13,"removeObserver:name:object:",_delegate,CPApplicationWillFinishLaunchingNotification,_10);
objj_msgSend(_13,"removeObserver:name:object:",_delegate,CPApplicationDidFinishLaunchingNotification,_10);
objj_msgSend(_13,"removeObserver:name:object:",_delegate,CPApplicationWillBecomeActiveNotification,_10);
objj_msgSend(_13,"removeObserver:name:object:",_delegate,CPApplicationDidBecomeActiveNotification,_10);
objj_msgSend(_13,"removeObserver:name:object:",_delegate,CPApplicationWillResignActiveNotification,_10);
objj_msgSend(_13,"removeObserver:name:object:",_delegate,CPApplicationDidResignActiveNotification,_10);
}
_delegate=_12;
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("applicationWillFinishLaunching:"))){
objj_msgSend(_13,"addObserver:selector:name:object:",_delegate,sel_getUid("applicationWillFinishLaunching:"),CPApplicationWillFinishLaunchingNotification,_10);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("applicationDidFinishLaunching:"))){
objj_msgSend(_13,"addObserver:selector:name:object:",_delegate,sel_getUid("applicationDidFinishLaunching:"),CPApplicationDidFinishLaunchingNotification,_10);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("applicationWillBecomeActive:"))){
objj_msgSend(_13,"addObserver:selector:name:object:",_delegate,sel_getUid("applicationWillBecomeActive:"),CPApplicationWillBecomeActiveNotification,_10);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("applicationDidBecomeActive:"))){
objj_msgSend(_13,"addObserver:selector:name:object:",_delegate,sel_getUid("applicationDidBecomeActive:"),CPApplicationDidBecomeActiveNotification,_10);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("applicationWillResignActive:"))){
objj_msgSend(_13,"addObserver:selector:name:object:",_delegate,sel_getUid("applicationWillResignActive:"),CPApplicationWillResignActiveNotification,_10);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("applicationDidResignActive:"))){
objj_msgSend(_13,"addObserver:selector:name:object:",_delegate,sel_getUid("applicationDidResignActive:"),CPApplicationDidResignActiveNotification,_10);
}
}
}),new objj_method(sel_getUid("delegate"),function(_14,_15){
with(_14){
return _delegate;
}
}),new objj_method(sel_getUid("finishLaunching"),function(_16,_17){
with(_16){
window.status=" ";
objj_msgSend(objj_msgSend(CPCursor,"arrowCursor"),"set");
var _18=objj_msgSend(CPBundle,"mainBundle"),_19=objj_msgSend(_18,"objectForInfoDictionaryKey:","CPBundleDocumentTypes");
if(objj_msgSend(_19,"count")>0){
_documentController=objj_msgSend(CPDocumentController,"sharedDocumentController");
}
var _1a=objj_msgSend(_18,"objectForInfoDictionaryKey:","CPApplicationDelegateClass");
if(_1a){
var _1b=objj_getClass(_1a);
if(_1b){
if(objj_msgSend(_documentController,"class")==_1b){
objj_msgSend(_16,"setDelegate:",_documentController);
}else{
objj_msgSend(_16,"setDelegate:",objj_msgSend(objj_msgSend(_1b,"alloc"),"init"));
}
}
}
var _1c=objj_msgSend(CPNotificationCenter,"defaultCenter");
objj_msgSend(_1c,"postNotificationName:object:",CPApplicationWillFinishLaunchingNotification,_16);
var _1d=!!_documentController,_1e=window.cpOpeningURLStrings&&window.cpOpeningURLStrings(),_1f=0,_20=objj_msgSend(_1e,"count");
for(;_1f<_20;++_1f){
_1d=!objj_msgSend(_16,"_openURL:",objj_msgSend(CPURL,"URLWithString:",_1e[_1f]))||_1d;
}
if(_1d&&objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("applicationShouldOpenUntitledFile:"))){
_1d=objj_msgSend(_delegate,"applicationShouldOpenUntitledFile:",_16);
}
if(_1d){
objj_msgSend(_documentController,"newDocument:",_16);
}
objj_msgSend(_documentController,"_updateRecentDocumentsMenu");
objj_msgSend(_1c,"postNotificationName:object:",CPApplicationDidFinishLaunchingNotification,_16);
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
_finishedLaunching=YES;
}
}),new objj_method(sel_getUid("terminate:"),function(_21,_22,_23){
with(_21){
if(!objj_msgSend(CPPlatform,"isBrowser")){
objj_msgSend(objj_msgSend(CPDocumentController,"sharedDocumentController"),"closeAllDocumentsWithDelegate:didCloseAllSelector:contextInfo:",_21,sel_getUid("_documentController:didCloseAll:context:"),nil);
}else{
objj_msgSend(objj_msgSend(objj_msgSend(_21,"keyWindow"),"platformWindow"),"_propagateCurrentDOMEvent:",YES);
}
}
}),new objj_method(sel_getUid("setApplicationIconImage:"),function(_24,_25,_26){
with(_24){
_applicationIconImage=_26;
}
}),new objj_method(sel_getUid("applicationIconImage"),function(_27,_28){
with(_27){
if(_applicationIconImage){
return _applicationIconImage;
}
var _29=objj_msgSend(objj_msgSend(CPBundle,"mainBundle"),"objectForInfoDictionaryKey:","CPApplicationIcon");
if(_29){
_applicationIconImage=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:",_29);
}
return _applicationIconImage;
}
}),new objj_method(sel_getUid("orderFrontStandardAboutPanel:"),function(_2a,_2b,_2c){
with(_2a){
objj_msgSend(_2a,"orderFrontStandardAboutPanelWithOptions:",nil);
}
}),new objj_method(sel_getUid("orderFrontStandardAboutPanelWithOptions:"),function(_2d,_2e,_2f){
with(_2d){
if(!_aboutPanel){
var _30=objj_msgSend(objj_msgSend(CPBundle,"mainBundle"),"infoDictionary"),_31=objj_msgSend(_2f,"objectForKey:","ApplicationName")||objj_msgSend(_30,"objectForKey:","CPBundleName"),_32=objj_msgSend(_2f,"objectForKey:","ApplicationIcon")||objj_msgSend(_2d,"applicationIconImage"),_33=objj_msgSend(_2f,"objectForKey:","Version")||objj_msgSend(_30,"objectForKey:","CPBundleVersion"),_34=objj_msgSend(_2f,"objectForKey:","ApplicationVersion")||objj_msgSend(_30,"objectForKey:","CPBundleShortVersionString"),_35=objj_msgSend(_2f,"objectForKey:","Copyright")||objj_msgSend(_30,"objectForKey:","CPHumanReadableCopyright");
var _36=objj_msgSend(objj_msgSend(CPWindowController,"alloc"),"initWithWindowCibName:","AboutPanel"),_37=objj_msgSend(_36,"window"),_38=objj_msgSend(_37,"contentView"),_39=objj_msgSend(_38,"viewWithTag:",1),_3a=objj_msgSend(_38,"viewWithTag:",2),_3b=objj_msgSend(_38,"viewWithTag:",3),_3c=objj_msgSend(_38,"viewWithTag:",4),_3d=objj_msgSend(objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(_2d,"class")),"pathForResource:","standardApplicationIcon.png");
objj_msgSend(_3a,"setFont:",objj_msgSend(CPFont,"boldSystemFontOfSize:",14));
objj_msgSend(_3a,"setAlignment:",CPCenterTextAlignment);
objj_msgSend(_3b,"setAlignment:",CPCenterTextAlignment);
objj_msgSend(_3c,"setAlignment:",CPCenterTextAlignment);
objj_msgSend(_39,"setImage:",_32||objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",_3d,CGSizeMake(256,256)));
objj_msgSend(_3a,"setStringValue:",_31||"");
if(_34&&_33){
objj_msgSend(_3b,"setStringValue:","Version "+_34+" ("+_33+")");
}else{
if(_34||_33){
objj_msgSend(_3b,"setStringValue:","Version "+(_34||_33));
}else{
objj_msgSend(_3b,"setStringValue:","");
}
}
objj_msgSend(_3c,"setStringValue:",_35||"");
objj_msgSend(_37,"center");
_aboutPanel=_37;
}
objj_msgSend(_aboutPanel,"orderFront:",_2d);
}
}),new objj_method(sel_getUid("_documentController:didCloseAll:context:"),function(_3e,_3f,_40,_41,_42){
with(_3e){
if(_41){
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("applicationShouldTerminate:"))){
objj_msgSend(_3e,"replyToApplicationShouldTerminate:",objj_msgSend(_delegate,"applicationShouldTerminate:",_3e));
}else{
objj_msgSend(_3e,"replyToApplicationShouldTerminate:",YES);
}
}
}
}),new objj_method(sel_getUid("replyToApplicationShouldTerminate:"),function(_43,_44,_45){
with(_43){
if(_45==CPTerminateNow){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPApplicationWillTerminateNotification,_43);
objj_msgSend(CPPlatform,"terminateApplication");
}
}
}),new objj_method(sel_getUid("activateIgnoringOtherApps:"),function(_46,_47,_48){
with(_46){
objj_msgSend(_46,"_willBecomeActive");
objj_msgSend(CPPlatform,"activateIgnoringOtherApps:",_48);
_isActive=YES;
objj_msgSend(_46,"_willResignActive");
}
}),new objj_method(sel_getUid("deactivate"),function(_49,_4a){
with(_49){
objj_msgSend(_49,"_willResignActive");
objj_msgSend(CPPlatform,"deactivate");
_isActive=NO;
objj_msgSend(_49,"_didResignActive");
}
}),new objj_method(sel_getUid("isActive"),function(_4b,_4c){
with(_4b){
return _isActive;
}
}),new objj_method(sel_getUid("hideOtherApplications:"),function(_4d,_4e,_4f){
with(_4d){
objj_msgSend(CPPlatform,"hideOtherApplications:",_4d);
}
}),new objj_method(sel_getUid("run"),function(_50,_51){
with(_50){
objj_msgSend(_50,"finishLaunching");
}
}),new objj_method(sel_getUid("runModalForWindow:"),function(_52,_53,_54){
with(_52){
objj_msgSend(_52,"runModalSession:",objj_msgSend(_52,"beginModalSessionForWindow:",_54));
}
}),new objj_method(sel_getUid("stopModalWithCode:"),function(_55,_56,_57){
with(_55){
if(!_currentSession){
return;
}
_currentSession._state=_57;
_currentSession=_currentSession._previous;
objj_msgSend(_55,"_removeRunModalLoop");
}
}),new objj_method(sel_getUid("_removeRunModalLoop"),function(_58,_59){
with(_58){
var _5a=_eventListeners.length;
while(_5a--){
if(_eventListeners[_5a]._callback===_5b){
_eventListeners.splice(_5a,1);
return;
}
}
}
}),new objj_method(sel_getUid("stopModal"),function(_5c,_5d){
with(_5c){
objj_msgSend(_5c,"stopModalWithCode:",CPRunStoppedResponse);
}
}),new objj_method(sel_getUid("abortModal"),function(_5e,_5f){
with(_5e){
objj_msgSend(_5e,"stopModalWithCode:",CPRunAbortedResponse);
}
}),new objj_method(sel_getUid("beginModalSessionForWindow:"),function(_60,_61,_62){
with(_60){
return _63(_62,0);
}
}),new objj_method(sel_getUid("runModalSession:"),function(_64,_65,_66){
with(_64){
_66._previous=_currentSession;
_currentSession=_66;
var _67=_66._window;
objj_msgSend(_67,"center");
objj_msgSend(_67,"makeKeyAndOrderFront:",_64);
objj_msgSend(CPApp,"setCallback:forNextEventMatchingMask:untilDate:inMode:dequeue:",_5b,CPAnyEventMask,nil,0,NO);
}
}),new objj_method(sel_getUid("modalWindow"),function(_68,_69){
with(_68){
if(!_currentSession){
return nil;
}
return _currentSession._window;
}
}),new objj_method(sel_getUid("_handleKeyEquivalent:"),function(_6a,_6b,_6c){
with(_6a){
return objj_msgSend(objj_msgSend(_6a,"keyWindow"),"performKeyEquivalent:",_6c)||objj_msgSend(_mainMenu,"performKeyEquivalent:",_6c);
}
}),new objj_method(sel_getUid("sendEvent:"),function(_6d,_6e,_6f){
with(_6d){
_currentEvent=_6f;
var _70=objj_msgSend(objj_msgSend(objj_msgSend(_6f,"window"),"platformWindow"),"_willPropagateCurrentDOMEvent");
objj_msgSend(objj_msgSend(objj_msgSend(_6f,"window"),"platformWindow"),"_propagateCurrentDOMEvent:",NO);
if(objj_msgSend(_6f,"_couldBeKeyEquivalent")&&objj_msgSend(_6d,"_handleKeyEquivalent:",_6f)){
var _71=objj_msgSend(_6f,"characters"),_72=objj_msgSend(_6f,"modifierFlags");
if((_71=="c"||_71=="x"||_71=="v")&&(_72&CPPlatformActionKeyMask)){
objj_msgSend(objj_msgSend(objj_msgSend(_6f,"window"),"platformWindow"),"_propagateCurrentDOMEvent:",YES);
}
return;
}
objj_msgSend(objj_msgSend(objj_msgSend(_6f,"window"),"platformWindow"),"_propagateCurrentDOMEvent:",_70);
if(_eventListeners.length){
if(_eventListeners[_eventListeners.length-1]._mask&(1<<objj_msgSend(_6f,"type"))){
_eventListeners.pop()._callback(_6f);
}
return;
}
objj_msgSend(objj_msgSend(_6f,"window"),"sendEvent:",_6f);
}
}),new objj_method(sel_getUid("doCommandBySelector:"),function(_73,_74,_75){
with(_73){
if(objj_msgSend(_delegate,"respondsToSelector:",_75)){
objj_msgSend(_delegate,"performSelector:",_75);
}else{
objj_msgSendSuper({receiver:_73,super_class:objj_getClass("CPApplication").super_class},"doCommandBySelector:",_75);
}
}
}),new objj_method(sel_getUid("keyWindow"),function(_76,_77){
with(_76){
return _keyWindow;
}
}),new objj_method(sel_getUid("mainWindow"),function(_78,_79){
with(_78){
return _mainWindow;
}
}),new objj_method(sel_getUid("windowWithWindowNumber:"),function(_7a,_7b,_7c){
with(_7a){
return _windows[_7c];
}
}),new objj_method(sel_getUid("windows"),function(_7d,_7e){
with(_7d){
return _windows;
}
}),new objj_method(sel_getUid("orderedWindows"),function(_7f,_80){
with(_7f){
return CPWindowObjectList();
}
}),new objj_method(sel_getUid("hide:"),function(_81,_82,_83){
with(_81){
objj_msgSend(CPPlatform,"hide:",_81);
}
}),new objj_method(sel_getUid("mainMenu"),function(_84,_85){
with(_84){
return _mainMenu;
}
}),new objj_method(sel_getUid("setMainMenu:"),function(_86,_87,_88){
with(_86){
if(objj_msgSend(_88,"_menuName")==="CPMainMenu"){
if(_mainMenu===_88){
return;
}
_mainMenu=_88;
if(objj_msgSend(CPPlatform,"supportsNativeMainMenu")){
window.cpSetMainMenu(_mainMenu);
}
}else{
objj_msgSend(_88,"_setMenuName:","CPMainMenu");
}
}
}),new objj_method(sel_getUid("orderFrontColorPanel:"),function(_89,_8a,_8b){
with(_89){
objj_msgSend(objj_msgSend(CPColorPanel,"sharedColorPanel"),"orderFront:",_89);
}
}),new objj_method(sel_getUid("tryToPerform:with:"),function(_8c,_8d,_8e,_8f){
with(_8c){
if(!_8e){
return NO;
}
if(objj_msgSendSuper({receiver:_8c,super_class:objj_getClass("CPApplication").super_class},"tryToPerform:with:",_8e,_8f)){
return YES;
}
if(objj_msgSend(_delegate,"respondsToSelector:",_8e)){
objj_msgSend(_delegate,"performSelector:withObject:",_8e,_8f);
return YES;
}
return NO;
}
}),new objj_method(sel_getUid("sendAction:to:from:"),function(_90,_91,_92,_93,_94){
with(_90){
var _95=objj_msgSend(_90,"targetForAction:to:from:",_92,_93,_94);
if(!_95){
return NO;
}
objj_msgSend(_95,"performSelector:withObject:",_92,_94);
return YES;
}
}),new objj_method(sel_getUid("targetForAction:to:from:"),function(_96,_97,_98,_99,_9a){
with(_96){
if(!_98){
return nil;
}
if(_99){
return _99;
}
return objj_msgSend(_96,"targetForAction:",_98);
}
}),new objj_method(sel_getUid("_targetForWindow:action:"),function(_9b,_9c,_9d,_9e){
with(_9b){
var _9f=objj_msgSend(_9d,"firstResponder"),_a0=YES;
while(_9f){
if(objj_msgSend(_9f,"respondsToSelector:",_9e)){
return _9f;
}
if(_9f==_9d){
_a0=NO;
}
_9f=objj_msgSend(_9f,"nextResponder");
}
if(_a0&&objj_msgSend(_9d,"respondsToSelector:",_9e)){
return _9d;
}
var _a1=objj_msgSend(_9d,"delegate");
if(objj_msgSend(_a1,"respondsToSelector:",_9e)){
return _a1;
}
var _a2=objj_msgSend(_9d,"windowController");
if(objj_msgSend(_a2,"respondsToSelector:",_9e)){
return _a2;
}
var _a3=objj_msgSend(_a2,"document");
if(_a3!==_a1&&objj_msgSend(_a3,"respondsToSelector:",_9e)){
return _a3;
}
return nil;
}
}),new objj_method(sel_getUid("targetForAction:"),function(_a4,_a5,_a6){
with(_a4){
if(!_a6){
return nil;
}
var _a7=objj_msgSend(_a4,"_targetForWindow:action:",objj_msgSend(_a4,"keyWindow"),_a6);
if(_a7){
return _a7;
}
_a7=objj_msgSend(_a4,"_targetForWindow:action:",objj_msgSend(_a4,"mainWindow"),_a6);
if(_a7){
return _a7;
}
if(objj_msgSend(_a4,"respondsToSelector:",_a6)){
return _a4;
}
if(objj_msgSend(_delegate,"respondsToSelector:",_a6)){
return _delegate;
}
if(objj_msgSend(_documentController,"respondsToSelector:",_a6)){
return _documentController;
}
return nil;
}
}),new objj_method(sel_getUid("setCallback:forNextEventMatchingMask:untilDate:inMode:dequeue:"),function(_a8,_a9,_aa,_ab,_ac,_ad,_ae){
with(_a8){
_eventListeners.push(_af(_ab,_aa));
}
}),new objj_method(sel_getUid("setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:"),function(_b0,_b1,_b2,_b3,_b4,_b5,_b6,_b7){
with(_b0){
_eventListeners.push(_af(_b4,function(_b8){
objj_msgSend(_b2,_b3,_b8);
}));
}
}),new objj_method(sel_getUid("currentEvent"),function(_b9,_ba){
with(_b9){
return _currentEvent;
}
}),new objj_method(sel_getUid("beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:"),function(_bb,_bc,_bd,_be,_bf,_c0,_c1){
with(_bb){
var _c2=objj_msgSend(_bd,"styleMask");
if(!(_c2&CPDocModalWindowMask)){
objj_msgSend(CPException,"raise:reason:",CPInternalInconsistencyException,"Currently only CPDocModalWindowMask style mask is supported for attached sheets");
return;
}
objj_msgSend(_be,"orderFront:",_bb);
objj_msgSend(_be,"_attachSheet:modalDelegate:didEndSelector:contextInfo:",_bd,_bf,_c0,_c1);
}
}),new objj_method(sel_getUid("endSheet:returnCode:"),function(_c3,_c4,_c5,_c6){
with(_c3){
var _c7=objj_msgSend(_windows,"count");
while(--_c7>=0){
var _c8=objj_msgSend(_windows,"objectAtIndex:",_c7);
var _c9=_c8._sheetContext;
if(_c9!=nil&&_c9["sheet"]===_c5){
_c9["returnCode"]=_c6;
objj_msgSend(_c8,"_detachSheetWindow");
return;
}
}
}
}),new objj_method(sel_getUid("endSheet:"),function(_ca,_cb,_cc){
with(_ca){
objj_msgSend(_ca,"endSheet:returnCode:",_cc,0);
}
}),new objj_method(sel_getUid("arguments"),function(_cd,_ce){
with(_cd){
if(_fullArgsString!==window.location.hash){
objj_msgSend(_cd,"_reloadArguments");
}
return _args;
}
}),new objj_method(sel_getUid("setArguments:"),function(_cf,_d0,_d1){
with(_cf){
if(!_d1||_d1.length==0){
_args=[];
window.location.hash="#";
return;
}
if(objj_msgSend(_d1,"class")!=CPArray){
_d1=objj_msgSend(CPArray,"arrayWithObject:",_d1);
}
_args=_d1;
var _d2=objj_msgSend(_args,"copy");
for(var i=0,_d3=_d2.length;i<_d3;i++){
_d2[i]=encodeURIComponent(_d2[i]);
}
var _d4=objj_msgSend(_d2,"componentsJoinedByString:","/");
window.location.hash="#"+_d4;
}
}),new objj_method(sel_getUid("_reloadArguments"),function(_d5,_d6){
with(_d5){
_fullArgsString=window.location.hash;
if(_fullArgsString.length){
var _d7=_fullArgsString.substring(1).split("/");
for(var i=0,_d8=_d7.length;i<_d8;i++){
_d7[i]=decodeURIComponent(_d7[i]);
}
_args=_d7;
}else{
_args=[];
}
}
}),new objj_method(sel_getUid("namedArguments"),function(_d9,_da){
with(_d9){
return _namedArgs;
}
}),new objj_method(sel_getUid("_openURL:"),function(_db,_dc,_dd){
with(_db){
if(_delegate&&objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("application:openFile:"))){
CPLog.warn("application:openFile: is deprecated, use application:openURL: instead.");
return objj_msgSend(_delegate,"application:openFile:",_db,objj_msgSend(_dd,"absoluteString"));
}
if(_delegate&&objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("application:openURL:"))){
return objj_msgSend(_delegate,"application:openURL:",_db,_dd);
}
return !!objj_msgSend(_documentController,"openDocumentWithContentsOfURL:display:error:",_dd,YES,NULL);
}
}),new objj_method(sel_getUid("_willBecomeActive"),function(_de,_df){
with(_de){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:userInfo:",CPApplicationWillBecomeActiveNotification,_de,nil);
}
}),new objj_method(sel_getUid("_didBecomeActive"),function(_e0,_e1){
with(_e0){
if(!objj_msgSend(_e0,"keyWindow")&&_previousKeyWindow&&objj_msgSend(objj_msgSend(_e0,"windows"),"indexOfObjectIdenticalTo:",_previousKeyWindow)!==CPNotFound){
objj_msgSend(_previousKeyWindow,"makeKeyWindow");
}
if(!objj_msgSend(_e0,"mainWindow")&&_previousMainWindow&&objj_msgSend(objj_msgSend(_e0,"windows"),"indexOfObjectIdenticalTo:",_previousMainWindow)!==CPNotFound){
objj_msgSend(_previousMainWindow,"makeMainWindow");
}
if(objj_msgSend(_e0,"keyWindow")){
objj_msgSend(objj_msgSend(_e0,"keyWindow"),"orderFront:",_e0);
}else{
if(objj_msgSend(_e0,"mainWindow")){
objj_msgSend(objj_msgSend(_e0,"mainWindow"),"makeKeyAndOrderFront:",_e0);
}else{
objj_msgSend(objj_msgSend(_e0,"mainMenu")._menuWindow,"makeKeyWindow");
}
}
_previousKeyWindow=nil;
_previousMainWindow=nil;
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:userInfo:",CPApplicationDidBecomeActiveNotification,_e0,nil);
}
}),new objj_method(sel_getUid("_willResignActive"),function(_e2,_e3){
with(_e2){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:userInfo:",CPApplicationWillResignActiveNotification,_e2,nil);
}
}),new objj_method(sel_getUid("_didResignActive"),function(_e4,_e5){
with(_e4){
if(_e4._activeMenu){
objj_msgSend(_e4._activeMenu,"cancelTracking");
}
if(objj_msgSend(_e4,"keyWindow")){
_previousKeyWindow=objj_msgSend(_e4,"keyWindow");
objj_msgSend(_previousKeyWindow,"resignKeyWindow");
}
if(objj_msgSend(_e4,"mainWindow")){
_previousMainWindow=objj_msgSend(_e4,"mainWindow");
objj_msgSend(_previousMainWindow,"resignMainWindow");
}
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:userInfo:",CPApplicationDidResignActiveNotification,_e4,nil);
}
})]);
class_addMethods(_4,[new objj_method(sel_getUid("sharedApplication"),function(_e6,_e7){
with(_e6){
if(!CPApp){
CPApp=objj_msgSend(objj_msgSend(CPApplication,"alloc"),"init");
}
return CPApp;
}
}),new objj_method(sel_getUid("defaultThemeName"),function(_e8,_e9){
with(_e8){
return (objj_msgSend(objj_msgSend(CPBundle,"mainBundle"),"objectForInfoDictionaryKey:","CPDefaultTheme")||"Aristo");
}
})]);
var _63=function(_ea,_eb){
return {_window:_ea,_state:CPRunContinuesResponse,_previous:nil};
};
var _af=function(_ec,_ed){
return {_mask:_ec,_callback:_ed};
};
var _5b=function(_ee){
objj_msgSend(CPApp,"setCallback:forNextEventMatchingMask:untilDate:inMode:dequeue:",_5b,CPAnyEventMask,nil,0,NO);
var _ef=objj_msgSend(_ee,"window"),_f0=CPApp._currentSession;
if(_ef==_f0._window||objj_msgSend(_ef,"worksWhenModal")){
objj_msgSend(_ef,"sendEvent:",_ee);
}
};
CPApplicationMain=function(_f1,_f2){
var _f3=objj_msgSend(CPBundle,"mainBundle"),_f4=objj_msgSend(_f3,"principalClass");
if(!_f4){
_f4=objj_msgSend(CPApplication,"class");
}
objj_msgSend(_f4,"sharedApplication");
if(objj_msgSend(_f1,"containsObject:","debug")){
CPLogRegister(CPLogPopup);
}
CPApp._args=_f1;
CPApp._namedArgs=_f2;
objj_msgSend(_CPAppBootstrapper,"performActions");
};
var _f5=nil;
var _3=objj_allocateClassPair(CPObject,"_CPAppBootstrapper"),_4=_3.isa;
objj_registerClassPair(_3);
class_addMethods(_4,[new objj_method(sel_getUid("actions"),function(_f6,_f7){
with(_f6){
return [sel_getUid("bootstrapPlatform"),sel_getUid("loadDefaultTheme"),sel_getUid("loadMainCibFile")];
}
}),new objj_method(sel_getUid("performActions"),function(_f8,_f9){
with(_f8){
if(!_f5){
_f5=objj_msgSend(_f8,"actions");
}
while(_f5.length){
var _fa=_f5.shift();
if(objj_msgSend(_f8,_fa)){
return;
}
}
objj_msgSend(CPApp,"run");
}
}),new objj_method(sel_getUid("bootstrapPlatform"),function(_fb,_fc){
with(_fb){
return objj_msgSend(CPPlatform,"bootstrap");
}
}),new objj_method(sel_getUid("loadDefaultTheme"),function(_fd,_fe){
with(_fd){
var _ff=objj_msgSend(objj_msgSend(CPThemeBlend,"alloc"),"initWithContentsOfURL:",objj_msgSend(objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(CPApplication,"class")),"pathForResource:",objj_msgSend(CPApplication,"defaultThemeName")+".blend"));
objj_msgSend(_ff,"loadWithDelegate:",_fd);
return YES;
}
}),new objj_method(sel_getUid("blendDidFinishLoading:"),function(self,_100,_101){
with(self){
objj_msgSend(CPTheme,"setDefaultTheme:",objj_msgSend(CPTheme,"themeNamed:",objj_msgSend(CPApplication,"defaultThemeName")));
objj_msgSend(self,"performActions");
}
}),new objj_method(sel_getUid("loadMainCibFile"),function(self,_102){
with(self){
var _103=objj_msgSend(CPBundle,"mainBundle"),_104=objj_msgSend(_103,"objectForInfoDictionaryKey:",_1)||objj_msgSend(_103,"objectForInfoDictionaryKey:",_2);
if(_104){
objj_msgSend(_103,"loadCibFile:externalNameTable:loadDelegate:",_104,objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",CPApp,CPCibOwner),self);
return YES;
}
return NO;
}
}),new objj_method(sel_getUid("cibDidFinishLoading:"),function(self,_105,aCib){
with(self){
objj_msgSend(self,"performActions");
}
}),new objj_method(sel_getUid("cibDidFailToLoad:"),function(self,_106,aCib){
with(self){
throw new Error("Could not load main cib file (Did you forget to nib2cib it?).");
}
}),new objj_method(sel_getUid("reset"),function(self,_107){
with(self){
_f5=nil;
}
})]);
p;14;CPBezierPath.jt;4477;@STATIC;1.0;I;26;AppKit/CPGraphicsContext.jI;21;Foundation/CPObject.jt;4401;
objj_executeFile("AppKit/CPGraphicsContext.j",NO);
objj_executeFile("Foundation/CPObject.j",NO);
var _1=1;
var _2=objj_allocateClassPair(CPObject,"CPBezierPath"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_path"),new objj_ivar("_lineWidth")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("init"),function(_4,_5){
with(_4){
if(_4=objj_msgSendSuper({receiver:_4,super_class:objj_getClass("CPBezierPath").super_class},"init")){
_path=CGPathCreateMutable();
_lineWidth=objj_msgSend(objj_msgSend(_4,"class"),"defaultLineWidth");
}
return _4;
}
}),new objj_method(sel_getUid("moveToPoint:"),function(_6,_7,_8){
with(_6){
CGPathMoveToPoint(_path,nil,_8.x,_8.y);
}
}),new objj_method(sel_getUid("lineToPoint:"),function(_9,_a,_b){
with(_9){
CGPathAddLineToPoint(_path,nil,_b.x,_b.y);
}
}),new objj_method(sel_getUid("curveToPoint:controlPoint1:controlPoint2:"),function(_c,_d,_e,_f,_10){
with(_c){
CGPathAddCurveToPoint(_path,nil,_f.x,_f.y,_10.x,_10.y,_e.x,_e.y);
}
}),new objj_method(sel_getUid("closePath"),function(_11,_12){
with(_11){
CGPathCloseSubpath(_path);
}
}),new objj_method(sel_getUid("stroke"),function(_13,_14){
with(_13){
var ctx=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort");
CGContextBeginPath(ctx);
CGContextAddPath(ctx,_path);
CGContextSetLineWidth(ctx,objj_msgSend(_13,"lineWidth"));
CGContextClosePath(ctx);
CGContextStrokePath(ctx);
}
}),new objj_method(sel_getUid("fill"),function(_15,_16){
with(_15){
var ctx=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort");
CGContextBeginPath(ctx);
CGContextAddPath(ctx,_path);
CGContextSetLineWidth(ctx,objj_msgSend(_15,"lineWidth"));
CGContextClosePath(ctx);
CGContextFillPath(ctx);
}
}),new objj_method(sel_getUid("lineWidth"),function(_17,_18){
with(_17){
return _lineWidth;
}
}),new objj_method(sel_getUid("setLineWidth:"),function(_19,_1a,_1b){
with(_19){
_lineWidth=_1b;
}
}),new objj_method(sel_getUid("elementCount"),function(_1c,_1d){
with(_1c){
return _path.count;
}
}),new objj_method(sel_getUid("isEmpty"),function(_1e,_1f){
with(_1e){
return CGPathIsEmpty(_path);
}
}),new objj_method(sel_getUid("currentPoint"),function(_20,_21){
with(_20){
return CGPathGetCurrentPoint(_path);
}
}),new objj_method(sel_getUid("appendBezierPathWithPoints:count:"),function(_22,_23,_24,_25){
with(_22){
CGPathAddLines(_path,nil,_24,_25);
}
}),new objj_method(sel_getUid("appendBezierPathWithRect:"),function(_26,_27,_28){
with(_26){
CGPathAddRect(_path,nil,_28);
}
}),new objj_method(sel_getUid("appendBezierPathWithOvalInRect:"),function(_29,_2a,_2b){
with(_29){
CGPathAddPath(_path,nil,CGPathWithEllipseInRect(_2b));
}
}),new objj_method(sel_getUid("appendBezierPathWithRoundedRect:xRadius:yRadius:"),function(_2c,_2d,_2e,_2f,_30){
with(_2c){
CGPathAddPath(_path,nil,CGPathWithRoundedRectangleInRect(_2e,_2f,_30,YES,YES,YES,YES));
}
}),new objj_method(sel_getUid("appendBezierPath:"),function(_31,_32,_33){
with(_31){
CGPathAddPath(_path,nil,_33._path);
}
}),new objj_method(sel_getUid("removeAllPoints"),function(_34,_35){
with(_34){
_path=CGPathCreateMutable();
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("bezierPath"),function(_36,_37){
with(_36){
return objj_msgSend(objj_msgSend(_36,"alloc"),"init");
}
}),new objj_method(sel_getUid("bezierPathWithOvalInRect:"),function(_38,_39,_3a){
with(_38){
var _3b=objj_msgSend(_38,"bezierPath");
objj_msgSend(_3b,"appendBezierPathWithOvalInRect:",_3a);
return _3b;
}
}),new objj_method(sel_getUid("bezierPathWithRect:"),function(_3c,_3d,_3e){
with(_3c){
var _3f=objj_msgSend(_3c,"bezierPath");
objj_msgSend(_3f,"appendBezierPathWithRect:",_3e);
return _3f;
}
}),new objj_method(sel_getUid("defaultLineWidth"),function(_40,_41){
with(_40){
return _1;
}
}),new objj_method(sel_getUid("setDefaultLineWidth:"),function(_42,_43,_44){
with(_42){
_1=_44;
}
}),new objj_method(sel_getUid("fillRect:"),function(_45,_46,_47){
with(_45){
objj_msgSend(objj_msgSend(_45,"bezierPathWithRect:",_47),"fill");
}
}),new objj_method(sel_getUid("strokeRect:"),function(_48,_49,_4a){
with(_48){
objj_msgSend(objj_msgSend(_48,"bezierPathWithRect:",_4a),"stroke");
}
}),new objj_method(sel_getUid("strokeLineFromPoint:toPoint:"),function(_4b,_4c,_4d,_4e){
with(_4b){
var _4f=objj_msgSend(_4b,"bezierPath");
objj_msgSend(_4f,"moveToPoint:",_4d);
objj_msgSend(_4f,"lineToPoint:",_4e);
objj_msgSend(_4f,"stroke");
}
})]);
p;7;CPBox.jt;5932;@STATIC;1.0;i;8;CPView.jt;5901;
objj_executeFile("CPView.j",YES);
CPNoBorder=0;
CPLineBorder=1;
CPBezelBorder=2;
CPGrooveBorder=3;
var _1=objj_allocateClassPair(CPView,"CPBox"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_borderType"),new objj_ivar("_borderColor"),new objj_ivar("_fillColor"),new objj_ivar("_cornerRadius"),new objj_ivar("_borderWidth"),new objj_ivar("_contentMargin"),new objj_ivar("_contentView")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithFrame:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPBox").super_class},"initWithFrame:",_5);
if(_3){
_fillColor=objj_msgSend(CPColor,"clearColor");
_borderColor=objj_msgSend(CPColor,"blackColor");
_borderWidth=1;
_contentMargin=CGSizeMake(0,0);
_contentView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",objj_msgSend(_3,"bounds"));
objj_msgSend(_3,"addSubview:",_contentView);
}
return _3;
}
}),new objj_method(sel_getUid("borderRect"),function(_6,_7){
with(_6){
return objj_msgSend(_6,"bounds");
}
}),new objj_method(sel_getUid("borderType"),function(_8,_9){
with(_8){
return _borderType;
}
}),new objj_method(sel_getUid("setBorderType:"),function(_a,_b,_c){
with(_a){
_borderType=_c;
objj_msgSend(_a,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("borderColor"),function(_d,_e){
with(_d){
return _borderColor;
}
}),new objj_method(sel_getUid("setBorderColor:"),function(_f,_10,_11){
with(_f){
if(objj_msgSend(_11,"isEqual:",_borderColor)){
return;
}
_borderColor=_11;
objj_msgSend(_f,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("borderWidth"),function(_12,_13){
with(_12){
return _borderWidth;
}
}),new objj_method(sel_getUid("setBorderWidth:"),function(_14,_15,_16){
with(_14){
if(_16===_borderWidth){
return;
}
_borderWidth=_16;
objj_msgSend(_14,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("cornerRadius"),function(_17,_18){
with(_17){
return _cornerRadius;
}
}),new objj_method(sel_getUid("setCornerRadius:"),function(_19,_1a,_1b){
with(_19){
if(_1b===_cornerRadius){
return;
}
_cornerRadius=_1b;
objj_msgSend(_19,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("fillColor"),function(_1c,_1d){
with(_1c){
return _fillColor;
}
}),new objj_method(sel_getUid("setFillColor:"),function(_1e,_1f,_20){
with(_1e){
if(objj_msgSend(_20,"isEqual:",_fillColor)){
return;
}
_fillColor=_20;
objj_msgSend(_1e,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("contentView"),function(_21,_22){
with(_21){
return _contentView;
}
}),new objj_method(sel_getUid("setContentView:"),function(_23,_24,_25){
with(_23){
if(_25===_contentView){
return;
}
objj_msgSend(_25,"setFrame:",CGRectInset(objj_msgSend(_23,"bounds"),_contentMargin.width+_borderWidth,_contentMargin.height+_borderWidth));
objj_msgSend(_23,"replaceSubview:with:",_contentView,_25);
objj_msgSend(_25,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
_contentView=_25;
}
}),new objj_method(sel_getUid("contentViewMargins"),function(_26,_27){
with(_26){
return _contentMargin;
}
}),new objj_method(sel_getUid("setContentViewMargins:"),function(_28,_29,_2a){
with(_28){
if(_2a.width<0||_2a.height<0){
objj_msgSend(CPException,"raise:reason:",CPGenericException,"Margins must be positive");
}
_contentMargin=CGSizeMakeCopy(_2a);
objj_msgSend(_28,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("setFrameFromContentFrame:"),function(_2b,_2c,_2d){
with(_2b){
objj_msgSend(_2b,"setFrame:",CGRectInset(_2d,-(_contentMargin.width+_borderWidth),-(_contentMargin.height+_borderWidth)));
objj_msgSend(_2b,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("sizeToFit"),function(_2e,_2f){
with(_2e){
var _30=objj_msgSend(_contentView,"frame");
objj_msgSend(_2e,"setFrameSize:",CGSizeMake(_30.size.width+_contentMargin.width*2,_30.size.height+_contentMargin.height*2));
objj_msgSend(_contentView,"setFrameOrigin:",CGPointMake(_contentMargin.width,_contentMargin.height));
}
}),new objj_method(sel_getUid("drawRect:"),function(_31,_32,_33){
with(_31){
var _34=objj_msgSend(_31,"bounds"),_35=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort"),_36=_borderWidth/2,_37=CGRectMake(_34.origin.x+_36,_34.origin.y+_36,_34.size.width-_borderWidth,_34.size.height-_borderWidth),_38=CGRectMake(_34.origin.x+_36,_34.origin.y+_36,_34.size.width-_borderWidth,_34.size.height-_borderWidth);
CGContextSetFillColor(_35,objj_msgSend(_31,"fillColor"));
CGContextSetStrokeColor(_35,objj_msgSend(_31,"borderColor"));
CGContextSetLineWidth(_35,_borderWidth);
switch(_borderType){
case CPLineBorder:
CGContextFillRoundedRectangleInRect(_35,_38,_cornerRadius,YES,YES,YES,YES);
CGContextStrokeRoundedRectangleInRect(_35,_37,_cornerRadius,YES,YES,YES,YES);
break;
case CPBezelBorder:
CGContextFillRoundedRectangleInRect(_35,_38,_cornerRadius,YES,YES,YES,YES);
CGContextSetStrokeColor(_35,objj_msgSend(CPColor,"colorWithWhite:alpha:",190/255,1));
CGContextBeginPath(_35);
CGContextMoveToPoint(_35,_37.origin.x,_37.origin.y);
CGContextAddLineToPoint(_35,CGRectGetMinX(_37),CGRectGetMaxY(_37)),CGContextAddLineToPoint(_35,CGRectGetMaxX(_37),CGRectGetMaxY(_37)),CGContextAddLineToPoint(_35,CGRectGetMaxX(_37),CGRectGetMinY(_37)),CGContextStrokePath(_35);
CGContextSetStrokeColor(_35,objj_msgSend(CPColor,"colorWithWhite:alpha:",142/255,1));
CGContextBeginPath(_35);
CGContextMoveToPoint(_35,_34.origin.x,_37.origin.y);
CGContextAddLineToPoint(_35,CGRectGetMaxX(_34),CGRectGetMinY(_37));
CGContextStrokePath(_35);
break;
default:
break;
}
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("boxEnclosingView:"),function(_39,_3a,_3b){
with(_39){
var box=objj_msgSend(objj_msgSend(_39,"alloc"),"initWithFrame:",CGRectMakeZero()),_3c=objj_msgSend(_3b,"superview");
objj_msgSend(box,"setFrameFromContentFrame:",objj_msgSend(_3b,"frame"));
objj_msgSend(_3c,"replaceSubview:with:",_3b,box);
objj_msgSend(box,"setContentView:",_3b);
return box;
}
})]);
p;10;CPButton.jt;15880;@STATIC;1.0;i;21;_CPImageAndTextView.ji;12;CGGeometry.ji;11;CPControl.ji;17;CPStringDrawing.ji;12;CPCheckBox.ji;9;CPRadio.jt;15749;
objj_executeFile("_CPImageAndTextView.j",YES);
objj_executeFile("CGGeometry.j",YES);
objj_executeFile("CPControl.j",YES);
objj_executeFile("CPStringDrawing.j",YES);
CPRoundedBezelStyle=1;
CPRegularSquareBezelStyle=2;
CPThickSquareBezelStyle=3;
CPThickerSquareBezelStyle=4;
CPDisclosureBezelStyle=5;
CPShadowlessSquareBezelStyle=6;
CPCircularBezelStyle=7;
CPTexturedSquareBezelStyle=8;
CPHelpButtonBezelStyle=9;
CPSmallSquareBezelStyle=10;
CPTexturedRoundedBezelStyle=11;
CPRoundRectBezelStyle=12;
CPRecessedBezelStyle=13;
CPRoundedDisclosureBezelStyle=14;
CPHUDBezelStyle=-1;
CPMomentaryLightButton=0;
CPPushOnPushOffButton=1;
CPToggleButton=2;
CPSwitchButton=3;
CPRadioButton=4;
CPMomentaryChangeButton=5;
CPOnOffButton=6;
CPMomentaryPushInButton=7;
CPMomentaryPushButton=0;
CPMomentaryLight=7;
CPNoButtonMask=0;
CPContentsButtonMask=1;
CPPushInButtonMask=2;
CPGrayButtonMask=4;
CPBackgroundButtonMask=8;
CPNoCellMask=CPNoButtonMask;
CPContentsCellMask=CPContentsButtonMask;
CPPushInCellMask=CPPushInButtonMask;
CPChangeGrayCellMask=CPGrayButtonMask;
CPChangeBackgroundCellMask=CPBackgroundButtonMask;
CPButtonStateMixed=CPThemeState("mixed");
var _1=objj_allocateClassPair(CPControl,"CPButton"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_allowsMixedState"),new objj_ivar("_title"),new objj_ivar("_alternateTitle"),new objj_ivar("_image"),new objj_ivar("_alternateImage"),new objj_ivar("_showsStateBy"),new objj_ivar("_highlightsBy"),new objj_ivar("_imageDimsWhenDisabled"),new objj_ivar("_bezelStyle"),new objj_ivar("_controlSize")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithFrame:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPButton").super_class},"initWithFrame:",_5);
if(_3){
objj_msgSend(_3,"setValue:forThemeAttribute:",CPCenterTextAlignment,"alignment");
objj_msgSend(_3,"setValue:forThemeAttribute:",CPCenterVerticalTextAlignment,"vertical-alignment");
objj_msgSend(_3,"setValue:forThemeAttribute:",CPImageLeft,"image-position");
objj_msgSend(_3,"setValue:forThemeAttribute:",CPScaleNone,"image-scaling");
_controlSize=CPRegularControlSize;
objj_msgSend(_3,"setBordered:",YES);
}
return _3;
}
}),new objj_method(sel_getUid("allowsMixedState"),function(_6,_7){
with(_6){
return _allowsMixedState;
}
}),new objj_method(sel_getUid("setAllowsMixedState:"),function(_8,_9,_a){
with(_8){
_a=!!_a;
if(_allowsMixedState===_a){
return;
}
_allowsMixedState=_a;
if(!_allowsMixedState&&objj_msgSend(_8,"state")===CPMixedState){
objj_msgSend(_8,"setState:",CPOnState);
}
}
}),new objj_method(sel_getUid("setObjectValue:"),function(_b,_c,_d){
with(_b){
if(!_d||_d===""||(objj_msgSend(_d,"intValue")===0)){
_d=CPOffState;
}else{
if(!objj_msgSend(_d,"isKindOfClass:",objj_msgSend(CPNumber,"class"))){
_d=CPOnState;
}else{
if(_d>CPOnState){
_d=CPOnState;
}else{
if(_d<CPOffState){
if(objj_msgSend(_b,"allowsMixedState")){
_d=CPMixedState;
}else{
_d=CPOnState;
}
}
}
}
}
objj_msgSendSuper({receiver:_b,super_class:objj_getClass("CPButton").super_class},"setObjectValue:",_d);
switch(objj_msgSend(_b,"objectValue")){
case CPMixedState:
objj_msgSend(_b,"unsetThemeState:",CPThemeStateSelected);
objj_msgSend(_b,"setThemeState:",CPButtonStateMixed);
break;
case CPOnState:
objj_msgSend(_b,"unsetThemeState:",CPButtonStateMixed);
objj_msgSend(_b,"setThemeState:",CPThemeStateSelected);
break;
case CPOffState:
objj_msgSend(_b,"unsetThemeState:",CPThemeStateSelected|CPButtonStateMixed);
}
}
}),new objj_method(sel_getUid("nextState"),function(_e,_f){
with(_e){
if(objj_msgSend(_e,"allowsMixedState")){
var _10=objj_msgSend(_e,"state");
return _10-((_10===-1)?-2:1);
}
return 1-objj_msgSend(_e,"state");
}
}),new objj_method(sel_getUid("setNextState"),function(_11,_12){
with(_11){
objj_msgSend(_11,"setState:",objj_msgSend(_11,"nextState"));
}
}),new objj_method(sel_getUid("setState:"),function(_13,_14,_15){
with(_13){
objj_msgSend(_13,"setIntValue:",_15);
}
}),new objj_method(sel_getUid("state"),function(_16,_17){
with(_16){
return objj_msgSend(_16,"intValue");
}
}),new objj_method(sel_getUid("setTitle:"),function(_18,_19,_1a){
with(_18){
if(_title===_1a){
return;
}
_title=_1a;
objj_msgSend(_18,"setNeedsLayout");
objj_msgSend(_18,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("title"),function(_1b,_1c){
with(_1b){
return _title;
}
}),new objj_method(sel_getUid("setAlternateTitle:"),function(_1d,_1e,_1f){
with(_1d){
if(_alternateTitle===_1f){
return;
}
_alternateTitle=_1f;
objj_msgSend(_1d,"setNeedsLayout");
objj_msgSend(_1d,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("alternateTitle"),function(_20,_21){
with(_20){
return _alternateTitle;
}
}),new objj_method(sel_getUid("setImage:"),function(_22,_23,_24){
with(_22){
if(_image===_24){
return;
}
_image=_24;
objj_msgSend(_22,"setNeedsLayout");
objj_msgSend(_22,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("image"),function(_25,_26){
with(_25){
return _image;
}
}),new objj_method(sel_getUid("setAlternateImage:"),function(_27,_28,_29){
with(_27){
if(_alternateImage===_29){
return;
}
_alternateImage=_29;
objj_msgSend(_27,"setNeedsLayout");
objj_msgSend(_27,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("alternateImage"),function(_2a,_2b){
with(_2a){
return _alternateImage;
}
}),new objj_method(sel_getUid("setShowsStateBy:"),function(_2c,_2d,_2e){
with(_2c){
if(_showsStateBy===_2e){
return;
}
_showsStateBy=_2e;
objj_msgSend(_2c,"setNeedsDisplay:",YES);
objj_msgSend(_2c,"setNeedsLayout");
}
}),new objj_method(sel_getUid("showsStateBy"),function(_2f,_30){
with(_2f){
return _showsStateBy;
}
}),new objj_method(sel_getUid("setHighlightsBy:"),function(_31,_32,_33){
with(_31){
if(_highlightsBy===_33){
return;
}
_highlightsBy=_33;
if(objj_msgSend(_31,"hasThemeState:",CPThemeStateHighlighted)){
objj_msgSend(_31,"setNeedsDisplay:",YES);
objj_msgSend(_31,"setNeedsLayout");
}
}
}),new objj_method(sel_getUid("setButtonType:"),function(_34,_35,_36){
with(_34){
switch(_36){
case CPMomentaryLightButton:
objj_msgSend(_34,"setHighlightsBy:",CPChangeBackgroundCellMask);
objj_msgSend(_34,"setShowsStateBy:",CPNoCellMask);
break;
case CPMomentaryPushInButton:
objj_msgSend(_34,"setHighlightsBy:",CPPushInCellMask|CPChangeGrayCellMask);
objj_msgSend(_34,"setShowsStateBy:",CPNoCellMask);
break;
case CPMomentaryChangeButton:
objj_msgSend(_34,"setHighlightsBy:",CPContentsCellMask);
objj_msgSend(_34,"setShowsStateBy:",CPNoCellMask);
break;
case CPPushOnPushOffButton:
objj_msgSend(_34,"setHighlightsBy:",CPPushInCellMask|CPChangeGrayCellMask);
objj_msgSend(_34,"setShowsStateBy:",CPChangeBackgroundCellMask);
break;
case CPOnOffButton:
objj_msgSend(_34,"setHighlightsBy:",CPChangeBackgroundCellMask);
objj_msgSend(_34,"setShowsStateBy:",CPChangeBackgroundCellMask);
break;
case CPToggleButton:
objj_msgSend(_34,"setHighlightsBy:",CPPushInCellMask|CPContentsCellMask);
objj_msgSend(_34,"setShowsStateBy:",CPContentsCellMask);
break;
case CPSwitchButton:
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"The CPSwitchButton type is not supported in Cappuccino, use the CPCheckBox class instead.");
case CPRadioButton:
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"The CPRadioButton type is not supported in Cappuccino, use the CPRadio class instead.");
default:
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Unknown button type.");
}
objj_msgSend(_34,"setImageDimsWhenDisabled:",YES);
}
}),new objj_method(sel_getUid("setImageDimsWhenDisabled:"),function(_37,_38,_39){
with(_37){
_39=!!_39;
if(_imageDimsWhenDisabled===_39){
return;
}
_imageDimsWhenDisabled=_39;
if(_imageDimsWhenDisabled){
objj_msgSend(_37,"setNeedsDisplay:",YES);
objj_msgSend(_37,"setNeedsLayout");
}
}
}),new objj_method(sel_getUid("imageDimsWhenDisabled"),function(_3a,_3b){
with(_3a){
return _imageDimsWhenDisabled;
}
}),new objj_method(sel_getUid("startTrackingAt:"),function(_3c,_3d,_3e){
with(_3c){
objj_msgSend(_3c,"highlight:",YES);
return objj_msgSendSuper({receiver:_3c,super_class:objj_getClass("CPButton").super_class},"startTrackingAt:",_3e);
}
}),new objj_method(sel_getUid("stopTracking:at:mouseIsUp:"),function(_3f,_40,_41,_42,_43){
with(_3f){
objj_msgSend(_3f,"highlight:",NO);
objj_msgSendSuper({receiver:_3f,super_class:objj_getClass("CPButton").super_class},"stopTracking:at:mouseIsUp:",_41,_42,_43);
if(_43&&CGRectContainsPoint(objj_msgSend(_3f,"bounds"),_42)){
objj_msgSend(_3f,"setNextState");
}
}
}),new objj_method(sel_getUid("contentRectForBounds:"),function(_44,_45,_46){
with(_44){
var _47=objj_msgSend(_44,"currentValueForThemeAttribute:","content-inset");
if(((_47).top===0&&(_47).right===0&&(_47).bottom===0&&(_47).left===0)){
return _46;
}
_46.origin.x+=_47.left;
_46.origin.y+=_47.top;
_46.size.width-=_47.left+_47.right;
_46.size.height-=_47.top+_47.bottom;
return _46;
}
}),new objj_method(sel_getUid("bezelRectForBounds:"),function(_48,_49,_4a){
with(_48){
if(!objj_msgSend(_48,"isBordered")){
return {origin:{x:0,y:0},size:{width:0,height:0}};
}
var _4b=objj_msgSend(_48,"currentValueForThemeAttribute:","bezel-inset");
if(((_4b).top===0&&(_4b).right===0&&(_4b).bottom===0&&(_4b).left===0)){
return _4a;
}
_4a.origin.x+=_4b.left;
_4a.origin.y+=_4b.top;
_4a.size.width-=_4b.left+_4b.right;
_4a.size.height-=_4b.top+_4b.bottom;
return _4a;
}
}),new objj_method(sel_getUid("sizeToFit"),function(_4c,_4d){
with(_4c){
var _4e=objj_msgSend((objj_msgSend(_4c,"title")||" "),"sizeWithFont:",objj_msgSend(_4c,"currentValueForThemeAttribute:","font")),_4f=objj_msgSend(_4c,"currentValueForThemeAttribute:","content-inset"),_50=objj_msgSend(_4c,"currentValueForThemeAttribute:","min-size"),_51=objj_msgSend(_4c,"currentValueForThemeAttribute:","max-size");
_4e.width=MAX(_4e.width+_4f.left+_4f.right,_50.width);
_4e.height=MAX(_4e.height+_4f.top+_4f.bottom,_50.height);
if(_51.width>=0){
_4e.width=MIN(_4e.width,_51.width);
}
if(_51.height>=0){
_4e.height=MIN(_4e.height,_51.height);
}
objj_msgSend(_4c,"setFrameSize:",_4e);
}
}),new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"),function(_52,_53,_54){
with(_52){
if(_54==="bezel-view"){
return objj_msgSend(_52,"bezelRectForBounds:",objj_msgSend(_52,"bounds"));
}else{
if(_54==="content-view"){
return objj_msgSend(_52,"contentRectForBounds:",objj_msgSend(_52,"bounds"));
}
}
return objj_msgSendSuper({receiver:_52,super_class:objj_getClass("CPButton").super_class},"rectForEphemeralSubviewNamed:",_54);
}
}),new objj_method(sel_getUid("createEphemeralSubviewNamed:"),function(_55,_56,_57){
with(_55){
if(_57==="bezel-view"){
var _58=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",{origin:{x:0,y:0},size:{width:0,height:0}});
objj_msgSend(_58,"setHitTests:",NO);
return _58;
}else{
return objj_msgSend(objj_msgSend(_CPImageAndTextView,"alloc"),"initWithFrame:",{origin:{x:0,y:0},size:{width:0,height:0}});
}
}
}),new objj_method(sel_getUid("layoutSubviews"),function(_59,_5a){
with(_59){
var _5b=objj_msgSend(_59,"layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:","bezel-view",CPWindowBelow,"content-view");
objj_msgSend(_5b,"setBackgroundColor:",objj_msgSend(_59,"currentValueForThemeAttribute:","bezel-color"));
var _5c=objj_msgSend(_59,"layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:","content-view",CPWindowAbove,"bezel-view");
if(_5c){
objj_msgSend(_5c,"setText:",(objj_msgSend(_59,"hasThemeState:",CPThemeStateHighlighted)&&_alternateTitle)?_alternateTitle:_title);
objj_msgSend(_5c,"setImage:",(objj_msgSend(_59,"hasThemeState:",CPThemeStateHighlighted)&&_alternateImage)?_alternateImage:_image);
objj_msgSend(_5c,"setFont:",objj_msgSend(_59,"currentValueForThemeAttribute:","font"));
objj_msgSend(_5c,"setTextColor:",objj_msgSend(_59,"currentValueForThemeAttribute:","text-color"));
objj_msgSend(_5c,"setAlignment:",objj_msgSend(_59,"currentValueForThemeAttribute:","alignment"));
objj_msgSend(_5c,"setVerticalAlignment:",objj_msgSend(_59,"currentValueForThemeAttribute:","vertical-alignment"));
objj_msgSend(_5c,"setLineBreakMode:",objj_msgSend(_59,"currentValueForThemeAttribute:","line-break-mode"));
objj_msgSend(_5c,"setTextShadowColor:",objj_msgSend(_59,"currentValueForThemeAttribute:","text-shadow-color"));
objj_msgSend(_5c,"setTextShadowOffset:",objj_msgSend(_59,"currentValueForThemeAttribute:","text-shadow-offset"));
objj_msgSend(_5c,"setImagePosition:",objj_msgSend(_59,"currentValueForThemeAttribute:","image-position"));
objj_msgSend(_5c,"setImageScaling:",objj_msgSend(_59,"currentValueForThemeAttribute:","image-scaling"));
}
}
}),new objj_method(sel_getUid("setDefaultButton:"),function(_5d,_5e,_5f){
with(_5d){
if(_5f){
objj_msgSend(_5d,"setThemeState:",CPThemeStateDefault);
}else{
objj_msgSend(_5d,"unsetThemeState:",CPThemeStateDefault);
}
}
}),new objj_method(sel_getUid("setBordered:"),function(_60,_61,_62){
with(_60){
if(_62){
objj_msgSend(_60,"setThemeState:",CPThemeStateBordered);
}else{
objj_msgSend(_60,"unsetThemeState:",CPThemeStateBordered);
}
}
}),new objj_method(sel_getUid("isBordered"),function(_63,_64){
with(_63){
return objj_msgSend(_63,"hasThemeState:",CPThemeStateBordered);
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("buttonWithTitle:"),function(_65,_66,_67){
with(_65){
return objj_msgSend(_65,"buttonWithTitle:theme:",_67,objj_msgSend(CPTheme,"defaultTheme"));
}
}),new objj_method(sel_getUid("buttonWithTitle:theme:"),function(_68,_69,_6a,_6b){
with(_68){
var _6c=objj_msgSend(objj_msgSend(_68,"alloc"),"init");
objj_msgSend(_6c,"setTheme:",_6b);
objj_msgSend(_6c,"setTitle:",_6a);
objj_msgSend(_6c,"sizeToFit");
return _6c;
}
}),new objj_method(sel_getUid("themeClass"),function(_6d,_6e){
with(_6d){
return "button";
}
}),new objj_method(sel_getUid("themeAttributes"),function(_6f,_70){
with(_6f){
return objj_msgSend(CPDictionary,"dictionaryWithObjects:forKeys:",[{top:(0),right:(0),bottom:(0),left:(0)},{top:(0),right:(0),bottom:(0),left:(0)},objj_msgSend(CPNull,"null")],["bezel-inset","content-inset","bezel-color"]);
}
})]);
var _1=objj_getClass("CPButton");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPButton\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("setBezelStyle:"),function(_71,_72,_73){
with(_71){
}
}),new objj_method(sel_getUid("bezelStyle"),function(_74,_75){
with(_74){
}
})]);
var _76="CPButtonImageKey",_77="CPButtonAlternateImageKey",_78="CPButtonTitleKey",_79="CPButtonAlternateTitleKey",_7a="CPButtonIsBorderedKey";
var _1=objj_getClass("CPButton");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPButton\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_7b,_7c,_7d){
with(_7b){
_7b=objj_msgSendSuper({receiver:_7b,super_class:objj_getClass("CPButton").super_class},"initWithCoder:",_7d);
if(_7b){
_controlSize=CPRegularControlSize;
objj_msgSend(_7b,"setImage:",objj_msgSend(_7d,"decodeObjectForKey:",_76));
objj_msgSend(_7b,"setAlternateImage:",objj_msgSend(_7d,"decodeObjectForKey:",_77));
objj_msgSend(_7b,"setTitle:",objj_msgSend(_7d,"decodeObjectForKey:",_78));
objj_msgSend(_7b,"setAlternateTitle:",objj_msgSend(_7d,"decodeObjectForKey:",_79));
objj_msgSend(_7b,"setNeedsLayout");
objj_msgSend(_7b,"setNeedsDisplay:",YES);
}
return _7b;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_7e,_7f,_80){
with(_7e){
objj_msgSendSuper({receiver:_7e,super_class:objj_getClass("CPButton").super_class},"encodeWithCoder:",_80);
objj_msgSend(_80,"encodeObject:forKey:",_image,_76);
objj_msgSend(_80,"encodeObject:forKey:",_alternateImage,_77);
objj_msgSend(_80,"encodeObject:forKey:",_title,_78);
objj_msgSend(_80,"encodeObject:forKey:",_alternateTitle,_79);
}
})]);
objj_executeFile("CPCheckBox.j",YES);
objj_executeFile("CPRadio.j",YES);
p;13;CPButtonBar.jt;2014;@STATIC;1.0;I;15;AppKit/CPView.jt;1975;
objj_executeFile("AppKit/CPView.j",NO);
var _1=objj_allocateClassPair(CPControl,"CPButtonBar"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithFrame:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPButtonBar").super_class},"initWithFrame:",_5);
if(_3){
objj_msgSend(_3,"setNeedsLayout");
}
return _3;
}
}),new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"),function(_6,_7,_8){
with(_6){
if(_8==="bezel-view"){
return objj_msgSend(_6,"bounds");
}
return objj_msgSendSuper({receiver:_6,super_class:objj_getClass("CPButtonBar").super_class},"rectForEphemeralSubviewNamed:",_8);
}
}),new objj_method(sel_getUid("createEphemeralSubviewNamed:"),function(_9,_a,_b){
with(_9){
if(_b==="bezel-view"){
var _c=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",{origin:{x:0,y:0},size:{width:0,height:0}});
objj_msgSend(_c,"setHitTests:",NO);
return _c;
}
return objj_msgSendSuper({receiver:_9,super_class:objj_getClass("CPButtonBar").super_class},"createEphemeralSubviewNamed:",_b);
}
}),new objj_method(sel_getUid("layoutSubviews"),function(_d,_e){
with(_d){
var _f=objj_msgSend(_d,"layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:","bezel-view",CPWindowBelow,"");
if(_f){
objj_msgSend(_f,"setBackgroundColor:",objj_msgSend(_d,"currentValueForThemeAttribute:","bezel-color"));
}
}
}),new objj_method(sel_getUid("addSubview:"),function(_10,_11,_12){
with(_10){
objj_msgSendSuper({receiver:_10,super_class:objj_getClass("CPButtonBar").super_class},"addSubview:",_12);
objj_msgSend(_12,"setAutoresizingMask:",CPViewMinXMargin);
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("themeClass"),function(_13,_14){
with(_13){
return "button-bar";
}
}),new objj_method(sel_getUid("themeAttributes"),function(_15,_16){
with(_15){
return objj_msgSend(CPDictionary,"dictionaryWithObjects:forKeys:",[objj_msgSend(CPNull,"null")],["bezel-color"]);
}
})]);
p;12;CPCheckBox.jt;1047;@STATIC;1.0;i;10;CPButton.jt;1013;
objj_executeFile("CPButton.j",YES);
var _1=objj_allocateClassPair(CPButton,"CPCheckBox"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithFrame:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPCheckBox").super_class},"initWithFrame:",_5);
if(_3){
objj_msgSend(_3,"setHighlightsBy:",CPContentsCellMask);
objj_msgSend(_3,"setShowsStateBy:",CPContentsCellMask);
objj_msgSend(_3,"setImagePosition:",CPImageLeft);
objj_msgSend(_3,"setAlignment:",CPLeftTextAlignment);
objj_msgSend(_3,"setBordered:",YES);
}
return _3;
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("checkBoxWithTitle:theme:"),function(_6,_7,_8,_9){
with(_6){
return objj_msgSend(_6,"buttonWithTitle:theme:",_8,_9);
}
}),new objj_method(sel_getUid("checkBoxWithTitle:"),function(_a,_b,_c){
with(_a){
return objj_msgSend(_a,"buttonWithTitle:",_c);
}
}),new objj_method(sel_getUid("themeClass"),function(_d,_e){
with(_d){
return "check-box";
}
})]);
p;12;CPClipView.jt;4254;@STATIC;1.0;i;8;CPView.jt;4223;
objj_executeFile("CPView.j",YES);
var _1=objj_allocateClassPair(CPView,"CPClipView"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_documentView")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("setDocumentView:"),function(_3,_4,_5){
with(_3){
if(_documentView==_5){
return;
}
var _6=objj_msgSend(CPNotificationCenter,"defaultCenter");
if(_documentView){
objj_msgSend(_6,"removeObserver:name:object:",_3,CPViewFrameDidChangeNotification,_documentView);
objj_msgSend(_6,"removeObserver:name:object:",_3,CPViewBoundsDidChangeNotification,_documentView);
objj_msgSend(_documentView,"removeFromSuperview");
}
_documentView=_5;
if(_documentView){
objj_msgSend(_3,"addSubview:",_documentView);
objj_msgSend(_documentView,"setPostsFrameChangedNotifications:",YES);
objj_msgSend(_documentView,"setPostsBoundsChangedNotifications:",YES);
objj_msgSend(_6,"addObserver:selector:name:object:",_3,sel_getUid("viewFrameChanged:"),CPViewFrameDidChangeNotification,_documentView);
objj_msgSend(_6,"addObserver:selector:name:object:",_3,sel_getUid("viewBoundsChanged:"),CPViewBoundsDidChangeNotification,_documentView);
}
}
}),new objj_method(sel_getUid("documentView"),function(_7,_8){
with(_7){
return _documentView;
}
}),new objj_method(sel_getUid("constrainScrollPoint:"),function(_9,_a,_b){
with(_9){
if(!_documentView){
return {x:0,y:0};
}
var _c=objj_msgSend(_documentView,"frame");
_b.x=MAX(0,MIN(_b.x,MAX((_c.size.width)-(_bounds.size.width),0)));
_b.y=MAX(0,MIN(_b.y,MAX((_c.size.height)-(_bounds.size.height),0)));
return _b;
}
}),new objj_method(sel_getUid("setBoundsOrigin:"),function(_d,_e,_f){
with(_d){
if((_bounds.origin.x==_f.x&&_bounds.origin.y==_f.y)){
return;
}
objj_msgSendSuper({receiver:_d,super_class:objj_getClass("CPClipView").super_class},"setBoundsOrigin:",_f);
var _10=objj_msgSend(_d,"superview"),_11=objj_getClass("CPScrollView");
if(objj_msgSend(_10,"isKindOfClass:",_11)){
objj_msgSend(_10,"reflectScrolledClipView:",_d);
}
}
}),new objj_method(sel_getUid("scrollToPoint:"),function(_12,_13,_14){
with(_12){
objj_msgSend(_12,"setBoundsOrigin:",objj_msgSend(_12,"constrainScrollPoint:",_14));
}
}),new objj_method(sel_getUid("viewBoundsChanged:"),function(_15,_16,_17){
with(_15){
objj_msgSend(_15,"_constrainScrollPoint");
}
}),new objj_method(sel_getUid("viewFrameChanged:"),function(_18,_19,_1a){
with(_18){
objj_msgSend(_18,"_constrainScrollPoint");
}
}),new objj_method(sel_getUid("resizeSubviewsWithOldSize:"),function(_1b,_1c,_1d){
with(_1b){
objj_msgSendSuper({receiver:_1b,super_class:objj_getClass("CPClipView").super_class},"resizeSubviewsWithOldSize:",_1d);
objj_msgSend(_1b,"_constrainScrollPoint");
}
}),new objj_method(sel_getUid("_constrainScrollPoint"),function(_1e,_1f){
with(_1e){
var _20=objj_msgSend(_1e,"bounds").origin;
objj_msgSend(_1e,"scrollToPoint:",_20);
if(!CGPointEqualToPoint(_20,objj_msgSend(_1e,"bounds").origin)){
return;
}
var _21=objj_msgSend(_1e,"superview"),_22=objj_getClass("CPScrollView");
if(objj_msgSend(_21,"isKindOfClass:",_22)){
objj_msgSend(_21,"reflectScrolledClipView:",_1e);
}
}
}),new objj_method(sel_getUid("autoscroll:"),function(_23,_24,_25){
with(_23){
var _26=objj_msgSend(_23,"bounds"),_27=objj_msgSend(_23,"convertPoint:fromView:",objj_msgSend(_25,"locationInWindow"),nil);
if(CPRectContainsPoint(_26,_27)){
return NO;
}
var _28=CGRectMakeZero();
_28.origin=_27;
_28.size=CPSizeMake(10,10);
return objj_msgSend(_documentView,"scrollRectToVisible:",_28);
}
})]);
var _29="CPScrollViewDocumentView";
var _1=objj_getClass("CPClipView");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPClipView\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_2a,_2b,_2c){
with(_2a){
if(_2a=objj_msgSendSuper({receiver:_2a,super_class:objj_getClass("CPClipView").super_class},"initWithCoder:",_2c)){
objj_msgSend(_2a,"setDocumentView:",objj_msgSend(_2c,"decodeObjectForKey:",_29));
}
return _2a;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_2d,_2e,_2f){
with(_2d){
objj_msgSendSuper({receiver:_2d,super_class:objj_getClass("CPClipView").super_class},"encodeWithCoder:",_2f);
objj_msgSend(_2f,"encodeObject:forKey:",_documentView,_29);
}
})]);
p;18;CPCollectionView.jt;17959;@STATIC;1.0;I;20;Foundation/CPArray.jI;19;Foundation/CPData.jI;23;Foundation/CPIndexSet.jI;28;Foundation/CPKeyedArchiver.jI;30;Foundation/CPKeyedUnarchiver.ji;8;CPView.ji;22;CPCollectionViewItem.jt;17755;
objj_executeFile("Foundation/CPArray.j",NO);
objj_executeFile("Foundation/CPData.j",NO);
objj_executeFile("Foundation/CPIndexSet.j",NO);
objj_executeFile("Foundation/CPKeyedArchiver.j",NO);
objj_executeFile("Foundation/CPKeyedUnarchiver.j",NO);
objj_executeFile("CPView.j",YES);
objj_executeFile("CPCollectionViewItem.j",YES);
var _1=objj_allocateClassPair(CPView,"CPCollectionView"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_content"),new objj_ivar("_items"),new objj_ivar("_itemData"),new objj_ivar("_itemPrototype"),new objj_ivar("_itemForDragging"),new objj_ivar("_cachedItems"),new objj_ivar("_maxNumberOfRows"),new objj_ivar("_maxNumberOfColumns"),new objj_ivar("_minItemSize"),new objj_ivar("_maxItemSize"),new objj_ivar("_backgroundColors"),new objj_ivar("_tileWidth"),new objj_ivar("_isSelectable"),new objj_ivar("_allowsMultipleSelection"),new objj_ivar("_allowsEmptySelection"),new objj_ivar("_selectionIndexes"),new objj_ivar("_itemSize"),new objj_ivar("_horizontalMargin"),new objj_ivar("_verticalMargin"),new objj_ivar("_numberOfRows"),new objj_ivar("_numberOfColumns"),new objj_ivar("_delegate"),new objj_ivar("_mouseDownEvent")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithFrame:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPCollectionView").super_class},"initWithFrame:",_5);
if(_3){
_items=[];
_content=[];
_cachedItems=[];
_itemSize=CGSizeMakeZero();
_minItemSize=CGSizeMakeZero();
_maxItemSize=CGSizeMakeZero();
objj_msgSend(_3,"setBackgroundColors:",nil);
_verticalMargin=5;
_tileWidth=-1;
_selectionIndexes=objj_msgSend(CPIndexSet,"indexSet");
_allowsEmptySelection=YES;
_isSelectable=YES;
}
return _3;
}
}),new objj_method(sel_getUid("setItemPrototype:"),function(_6,_7,_8){
with(_6){
_cachedItems=[];
_itemData=nil;
_itemForDragging=nil;
_itemPrototype=_8;
objj_msgSend(_6,"reloadContent");
}
}),new objj_method(sel_getUid("itemPrototype"),function(_9,_a){
with(_9){
return _itemPrototype;
}
}),new objj_method(sel_getUid("newItemForRepresentedObject:"),function(_b,_c,_d){
with(_b){
var _e=nil;
if(_cachedItems.length){
_e=_cachedItems.pop();
}else{
if(!_itemData){
if(_itemPrototype){
_itemData=objj_msgSend(CPKeyedArchiver,"archivedDataWithRootObject:",_itemPrototype);
}
}
_e=objj_msgSend(CPKeyedUnarchiver,"unarchiveObjectWithData:",_itemData);
}
objj_msgSend(_e,"setRepresentedObject:",_d);
objj_msgSend(objj_msgSend(_e,"view"),"setFrameSize:",_itemSize);
return _e;
}
}),new objj_method(sel_getUid("acceptsFirstResponder"),function(_f,_10){
with(_f){
return YES;
}
}),new objj_method(sel_getUid("isFirstResponder"),function(_11,_12){
with(_11){
return objj_msgSend(objj_msgSend(_11,"window"),"firstResponder")===_11;
}
}),new objj_method(sel_getUid("setContent:"),function(_13,_14,_15){
with(_13){
if(_content==_15){
return;
}
_content=_15;
objj_msgSend(_13,"reloadContent");
}
}),new objj_method(sel_getUid("content"),function(_16,_17){
with(_16){
return _content;
}
}),new objj_method(sel_getUid("items"),function(_18,_19){
with(_18){
return _items;
}
}),new objj_method(sel_getUid("setSelectable:"),function(_1a,_1b,_1c){
with(_1a){
if(_isSelectable==_1c){
return;
}
_isSelectable=_1c;
if(!_isSelectable){
var _1d=CPNotFound;
while((_1d=objj_msgSend(_selectionIndexes,"indexGreaterThanIndex:",_1d))!=CPNotFound){
objj_msgSend(_items[_1d],"setSelected:",NO);
}
}
}
}),new objj_method(sel_getUid("isSelectable"),function(_1e,_1f){
with(_1e){
return _isSelectable;
}
}),new objj_method(sel_getUid("setAllowsEmptySelection:"),function(_20,_21,_22){
with(_20){
_allowsEmptySelection=_22;
}
}),new objj_method(sel_getUid("allowsEmptySelection"),function(_23,_24){
with(_23){
return _allowsEmptySelection;
}
}),new objj_method(sel_getUid("setAllowsMultipleSelection:"),function(_25,_26,_27){
with(_25){
_allowsMultipleSelection=_27;
}
}),new objj_method(sel_getUid("allowsMultipleSelection"),function(_28,_29){
with(_28){
return _allowsMultipleSelection;
}
}),new objj_method(sel_getUid("setSelectionIndexes:"),function(_2a,_2b,_2c){
with(_2a){
if(_selectionIndexes==_2c||!_isSelectable){
return;
}
var _2d=CPNotFound;
while((_2d=objj_msgSend(_selectionIndexes,"indexGreaterThanIndex:",_2d))!=CPNotFound){
objj_msgSend(_items[_2d],"setSelected:",NO);
}
_selectionIndexes=_2c;
var _2d=CPNotFound;
while((_2d=objj_msgSend(_selectionIndexes,"indexGreaterThanIndex:",_2d))!=CPNotFound){
objj_msgSend(_items[_2d],"setSelected:",YES);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("collectionViewDidChangeSelection:"))){
objj_msgSend(_delegate,"collectionViewDidChangeSelection:",_2a);
}
}
}),new objj_method(sel_getUid("selectionIndexes"),function(_2e,_2f){
with(_2e){
return objj_msgSend(_selectionIndexes,"copy");
}
}),new objj_method(sel_getUid("reloadContent"),function(_30,_31){
with(_30){
var _32=_items.length;
while(_32--){
objj_msgSend(objj_msgSend(_items[_32],"view"),"removeFromSuperview");
objj_msgSend(_items[_32],"setSelected:",NO);
_cachedItems.push(_items[_32]);
}
_items=[];
if(!_itemPrototype||!_content){
return;
}
var _33=0;
_32=_content.length;
for(;_33<_32;++_33){
_items.push(objj_msgSend(_30,"newItemForRepresentedObject:",_content[_33]));
objj_msgSend(_30,"addSubview:",objj_msgSend(_items[_33],"view"));
}
_33=CPNotFound;
while((_33=objj_msgSend(_selectionIndexes,"indexGreaterThanIndex:",_33))!=CPNotFound){
objj_msgSend(_items[_33],"setSelected:",YES);
}
objj_msgSend(_30,"tile");
}
}),new objj_method(sel_getUid("tile"),function(_34,_35){
with(_34){
var _36=CGRectGetWidth(objj_msgSend(_34,"bounds"));
if(!objj_msgSend(_content,"count")||_36==_tileWidth){
return;
}
var _37=CGSizeMakeCopy(_minItemSize);
_numberOfColumns=MAX(1,FLOOR(_36/_37.width));
if(_maxNumberOfColumns>0){
_numberOfColumns=MIN(_maxNumberOfColumns,_numberOfColumns);
}
var _38=_36-_numberOfColumns*_37.width,_39=NO;
if(_38>0&&_37.width<_maxItemSize.width){
_37.width=MIN(_maxItemSize.width,_37.width+FLOOR(_38/_numberOfColumns));
}
if(_maxNumberOfColumns==1&&_37.width<_maxItemSize.width&&_37.width<_36){
_37.width=MIN(_maxItemSize.width,_36);
}
if(!CGSizeEqualToSize(_itemSize,_37)){
_itemSize=_37;
_39=YES;
}
var _3a=0,_3b=_items.length;
if(_maxNumberOfColumns>0&&_maxNumberOfRows>0){
_3b=MIN(_3b,_maxNumberOfColumns*_maxNumberOfRows);
}
_numberOfRows=CEIL(_3b/_numberOfColumns);
_horizontalMargin=FLOOR((_36-_numberOfColumns*_37.width)/(_numberOfColumns+1));
var x=_horizontalMargin,y=-_37.height;
for(;_3a<_3b;++_3a){
if(_3a%_numberOfColumns==0){
x=_horizontalMargin;
y+=_verticalMargin+_37.height;
}
var _3c=objj_msgSend(_items[_3a],"view");
objj_msgSend(_3c,"setFrameOrigin:",CGPointMake(x,y));
if(_39){
objj_msgSend(_3c,"setFrameSize:",_itemSize);
}
x+=_37.width+_horizontalMargin;
}
_tileWidth=_36;
objj_msgSend(_34,"setFrameSize:",CGSizeMake(_36,y+_37.height+_verticalMargin));
_tileWidth=-1;
}
}),new objj_method(sel_getUid("resizeSubviewsWithOldSize:"),function(_3d,_3e,_3f){
with(_3d){
objj_msgSend(_3d,"tile");
}
}),new objj_method(sel_getUid("setMaxNumberOfRows:"),function(_40,_41,_42){
with(_40){
if(_maxNumberOfRows==_42){
return;
}
_maxNumberOfRows=_42;
objj_msgSend(_40,"tile");
}
}),new objj_method(sel_getUid("maxNumberOfRows"),function(_43,_44){
with(_43){
return _maxNumberOfRows;
}
}),new objj_method(sel_getUid("setMaxNumberOfColumns:"),function(_45,_46,_47){
with(_45){
if(_maxNumberOfColumns==_47){
return;
}
_maxNumberOfColumns=_47;
objj_msgSend(_45,"tile");
}
}),new objj_method(sel_getUid("maxNumberOfColumns"),function(_48,_49){
with(_48){
return _maxNumberOfColumns;
}
}),new objj_method(sel_getUid("numberOfRows"),function(_4a,_4b){
with(_4a){
return _numberOfRows;
}
}),new objj_method(sel_getUid("numberOfColumns"),function(_4c,_4d){
with(_4c){
return _numberOfColumns;
}
}),new objj_method(sel_getUid("setMinItemSize:"),function(_4e,_4f,_50){
with(_4e){
if(CGSizeEqualToSize(_minItemSize,_50)){
return;
}
_minItemSize=CGSizeMakeCopy(_50);
objj_msgSend(_4e,"tile");
}
}),new objj_method(sel_getUid("minItemSize"),function(_51,_52){
with(_51){
return _minItemSize;
}
}),new objj_method(sel_getUid("setMaxItemSize:"),function(_53,_54,_55){
with(_53){
if(CGSizeEqualToSize(_maxItemSize,_55)){
return;
}
_maxItemSize=CGSizeMakeCopy(_55);
objj_msgSend(_53,"tile");
}
}),new objj_method(sel_getUid("maxItemSize"),function(_56,_57){
with(_56){
return _maxItemSize;
}
}),new objj_method(sel_getUid("setBackgroundColors:"),function(_58,_59,_5a){
with(_58){
if(_backgroundColors===_5a){
return;
}
_backgroundColors=_5a;
if(!_backgroundColors){
_backgroundColors=objj_msgSend(CPColor,"whiteColor");
}
if(objj_msgSend(_backgroundColors,"count")===1){
objj_msgSend(_58,"setBackgroundColor:",_backgroundColors[0]);
}else{
objj_msgSend(_58,"setBackgroundColor:",nil);
}
objj_msgSend(_58,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("backgroundColors"),function(_5b,_5c){
with(_5b){
return _backgroundColors;
}
}),new objj_method(sel_getUid("mouseUp:"),function(_5d,_5e,_5f){
with(_5d){
if(objj_msgSend(_selectionIndexes,"count")&&objj_msgSend(_5f,"clickCount")==2&&objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("collectionView:didDoubleClickOnItemAtIndex:"))){
objj_msgSend(_delegate,"collectionView:didDoubleClickOnItemAtIndex:",_5d,objj_msgSend(_selectionIndexes,"firstIndex"));
}
}
}),new objj_method(sel_getUid("mouseDown:"),function(_60,_61,_62){
with(_60){
_mouseDownEvent=_62;
var _63=objj_msgSend(_60,"convertPoint:fromView:",objj_msgSend(_62,"locationInWindow"),nil),row=FLOOR(_63.y/(_itemSize.height+_verticalMargin)),_64=FLOOR(_63.x/(_itemSize.width+_horizontalMargin)),_65=row*_numberOfColumns+_64;
if(_65>=0&&_65<_items.length){
objj_msgSend(_60,"setSelectionIndexes:",objj_msgSend(CPIndexSet,"indexSetWithIndex:",_65));
}else{
if(_allowsEmptySelection){
objj_msgSend(_60,"setSelectionIndexes:",objj_msgSend(CPIndexSet,"indexSet"));
}
}
}
}),new objj_method(sel_getUid("mouseDragged:"),function(_66,_67,_68){
with(_66){
if(!objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("collectionView:dragTypesForItemsAtIndexes:"))){
return;
}
if(!objj_msgSend(_selectionIndexes,"count")){
return;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("collectionView:canDragItemsAtIndexes:withEvent:"))&&!objj_msgSend(_delegate,"collectionView:canDragItemsAtIndexes:withEvent:",_66,_selectionIndexes,_mouseDownEvent)){
return;
}
var _69=objj_msgSend(_delegate,"collectionView:dragTypesForItemsAtIndexes:",_66,_selectionIndexes);
objj_msgSend(objj_msgSend(CPPasteboard,"pasteboardWithName:",CPDragPboard),"declareTypes:owner:",_69,_66);
var _6a=objj_msgSend(_66,"convertPoint:fromView:",objj_msgSend(_68,"locationInWindow"),nil);
if(!_itemForDragging){
_itemForDragging=objj_msgSend(_66,"newItemForRepresentedObject:",_content[objj_msgSend(_selectionIndexes,"firstIndex")]);
}else{
objj_msgSend(_itemForDragging,"setRepresentedObject:",_content[objj_msgSend(_selectionIndexes,"firstIndex")]);
}
var _6b=objj_msgSend(_itemForDragging,"view");
objj_msgSend(_6b,"setFrameSize:",_itemSize);
objj_msgSend(_6b,"setAlphaValue:",0.7);
objj_msgSend(_66,"dragView:at:offset:event:pasteboard:source:slideBack:",_6b,objj_msgSend(objj_msgSend(_items[objj_msgSend(_selectionIndexes,"firstIndex")],"view"),"frame").origin,CGSizeMakeZero(),_mouseDownEvent,nil,_66,YES);
}
}),new objj_method(sel_getUid("pasteboard:provideDataForType:"),function(_6c,_6d,_6e,_6f){
with(_6c){
objj_msgSend(_6e,"setData:forType:",objj_msgSend(_delegate,"collectionView:dataForItemsAtIndexes:forType:",_6c,_selectionIndexes,_6f),_6f);
}
}),new objj_method(sel_getUid("setVerticalMargin:"),function(_70,_71,_72){
with(_70){
if(_verticalMargin==_72){
return;
}
_verticalMargin=_72;
objj_msgSend(_70,"tile");
}
}),new objj_method(sel_getUid("verticalMargin"),function(_73,_74){
with(_73){
return _verticalMargin;
}
}),new objj_method(sel_getUid("setDelegate:"),function(_75,_76,_77){
with(_75){
_delegate=_77;
}
}),new objj_method(sel_getUid("delegate"),function(_78,_79){
with(_78){
return _delegate;
}
}),new objj_method(sel_getUid("itemAtIndex:"),function(_7a,_7b,_7c){
with(_7a){
return objj_msgSend(_items,"objectAtIndex:",_7c);
}
}),new objj_method(sel_getUid("frameForItemAtIndex:"),function(_7d,_7e,_7f){
with(_7d){
return objj_msgSend(objj_msgSend(objj_msgSend(_7d,"itemAtIndex:",_7f),"view"),"frame");
}
}),new objj_method(sel_getUid("frameForItemsAtIndexes:"),function(_80,_81,_82){
with(_80){
var _83=[],_84=CGRectNull;
objj_msgSend(_82,"getIndexes:maxCount:inIndexRange:",_83,-1,nil);
var _85=0,_86=objj_msgSend(_83,"count");
for(;_85<_86;++_85){
_84=CGRectUnion(_84,objj_msgSend(_80,"rectForItemAtIndex:",_83[_85]));
}
return _84;
}
})]);
var _1=objj_getClass("CPCollectionView");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPCollectionView\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("_scrollToSelection"),function(_87,_88){
with(_87){
var _89=objj_msgSend(_87,"frameForItemsAtIndexes:",objj_msgSend(_87,"selectionIndexes"));
if(!CGRectIsNull(_89)){
objj_msgSend(_87,"scrollRectToVisible:",_89);
}
}
}),new objj_method(sel_getUid("moveLeft:"),function(_8a,_8b,_8c){
with(_8a){
var _8d=objj_msgSend(objj_msgSend(_8a,"selectionIndexes"),"firstIndex");
if(_8d===CPNotFound){
_8d=objj_msgSend(objj_msgSend(_8a,"items"),"count");
}
_8d=MAX(_8d-1,0);
objj_msgSend(_8a,"setSelectionIndexes:",objj_msgSend(CPIndexSet,"indexSetWithIndex:",_8d));
objj_msgSend(_8a,"_scrollToSelection");
}
}),new objj_method(sel_getUid("moveRight:"),function(_8e,_8f,_90){
with(_8e){
var _91=MIN(objj_msgSend(objj_msgSend(_8e,"selectionIndexes"),"firstIndex")+1,objj_msgSend(objj_msgSend(_8e,"items"),"count")-1);
objj_msgSend(_8e,"setSelectionIndexes:",objj_msgSend(CPIndexSet,"indexSetWithIndex:",_91));
objj_msgSend(_8e,"_scrollToSelection");
}
}),new objj_method(sel_getUid("moveDown:"),function(_92,_93,_94){
with(_92){
var _95=MIN(objj_msgSend(objj_msgSend(_92,"selectionIndexes"),"firstIndex")+objj_msgSend(_92,"numberOfColumns"),objj_msgSend(objj_msgSend(_92,"items"),"count")-1);
objj_msgSend(_92,"setSelectionIndexes:",objj_msgSend(CPIndexSet,"indexSetWithIndex:",_95));
objj_msgSend(_92,"_scrollToSelection");
}
}),new objj_method(sel_getUid("moveUp:"),function(_96,_97,_98){
with(_96){
var _99=objj_msgSend(objj_msgSend(_96,"selectionIndexes"),"firstIndex");
if(_99==CPNotFound){
_99=objj_msgSend(objj_msgSend(_96,"items"),"count");
}
_99=MAX(0,_99-objj_msgSend(_96,"numberOfColumns"));
objj_msgSend(_96,"setSelectionIndexes:",objj_msgSend(CPIndexSet,"indexSetWithIndex:",_99));
objj_msgSend(_96,"_scrollToSelection");
}
}),new objj_method(sel_getUid("deleteBackward:"),function(_9a,_9b,_9c){
with(_9a){
if(objj_msgSend(objj_msgSend(_9a,"delegate"),"respondsToSelector:",sel_getUid("collectionView:shouldDeleteItemsAtIndexes:"))){
objj_msgSend(objj_msgSend(_9a,"delegate"),"collectionView:shouldDeleteItemsAtIndexes:",_9a,objj_msgSend(_9a,"selectionIndexes"));
var _9d=objj_msgSend(objj_msgSend(_9a,"selectionIndexes"),"firstIndex");
if(_9d>objj_msgSend(objj_msgSend(_9a,"content"),"count")-1){
objj_msgSend(_9a,"setSelectionIndexes:",objj_msgSend(CPIndexSet,"indexSetWithIndex:",objj_msgSend(objj_msgSend(_9a,"content"),"count")-1));
}
objj_msgSend(_9a,"_scrollToSelection");
objj_msgSend(_9a,"setNeedsDisplay:",YES);
}
}
}),new objj_method(sel_getUid("keyDown:"),function(_9e,_9f,_a0){
with(_9e){
objj_msgSend(_9e,"interpretKeyEvents:",[_a0]);
}
})]);
var _1=objj_getClass("CPCollectionView");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPCollectionView\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("rectForItemAtIndex:"),function(_a1,_a2,_a3){
with(_a1){
_CPReportLenientDeprecation(objj_msgSend(_a1,"class"),_a2,sel_getUid("frameForItemAtIndex:"));
return objj_msgSend(_a1,"frameForItemAtIndex:",_a3);
}
}),new objj_method(sel_getUid("rectForItemsAtIndexes:"),function(_a4,_a5,_a6){
with(_a4){
_CPReportLenientDeprecation(objj_msgSend(_a4,"class"),_a5,sel_getUid("frameForItemsAtIndexes:"));
return objj_msgSend(_a4,"frameForItemsAtIndexes:",_a6);
}
})]);
var _a7="CPCollectionViewMinItemSizeKey",_a8="CPCollectionViewMaxItemSizeKey",_a9="CPCollectionViewVerticalMarginKey",_aa="CPCollectionViewSelectableKey",_ab="CPCollectionViewBackgroundColorsKey";
var _1=objj_getClass("CPCollectionView");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPCollectionView\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_ac,_ad,_ae){
with(_ac){
_ac=objj_msgSendSuper({receiver:_ac,super_class:objj_getClass("CPCollectionView").super_class},"initWithCoder:",_ae);
if(_ac){
_items=[];
_content=[];
_cachedItems=[];
_itemSize=CGSizeMakeZero();
_minItemSize=objj_msgSend(_ae,"decodeSizeForKey:",_a7)||CGSizeMakeZero();
_maxItemSize=objj_msgSend(_ae,"decodeSizeForKey:",_a8)||CGSizeMakeZero();
_verticalMargin=objj_msgSend(_ae,"decodeFloatForKey:",_a9);
_isSelectable=objj_msgSend(_ae,"decodeBoolForKey:",_aa);
objj_msgSend(_ac,"setBackgroundColors:",objj_msgSend(_ae,"decodeObjectForKey:",_ab));
_tileWidth=-1;
_selectionIndexes=objj_msgSend(CPIndexSet,"indexSet");
_allowsEmptySelection=YES;
}
return _ac;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_af,_b0,_b1){
with(_af){
objj_msgSendSuper({receiver:_af,super_class:objj_getClass("CPCollectionView").super_class},"encodeWithCoder:",_b1);
if(!CGSizeEqualToSize(_minItemSize,CGSizeMakeZero())){
objj_msgSend(_b1,"encodeSize:forKey:",_minItemSize,_a7);
}
if(!CGSizeEqualToSize(_maxItemSize,CGSizeMakeZero())){
objj_msgSend(_b1,"encodeSize:forKey:",_maxItemSize,_a8);
}
objj_msgSend(_b1,"encodeBool:forKey:",_isSelectable,_aa);
objj_msgSend(_b1,"encodeFloat:forKey:",_verticalMargin,_a9);
objj_msgSend(_b1,"encodeObject:forKey:",_backgroundColors,_ab);
}
})]);
p;22;CPCollectionViewItem.jt;1188;@STATIC;1.0;i;18;CPViewController.jt;1146;
objj_executeFile("CPViewController.j",YES);
var _1=objj_allocateClassPair(CPViewController,"CPCollectionViewItem"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_isSelected")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("setRepresentedObject:"),function(_3,_4,_5){
with(_3){
objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPCollectionViewItem").super_class},"setRepresentedObject:",_5);
var _6=objj_msgSend(_3,"view");
if(objj_msgSend(_6,"respondsToSelector:",sel_getUid("setRepresentedObject:"))){
objj_msgSend(_6,"setRepresentedObject:",objj_msgSend(_3,"representedObject"));
}
}
}),new objj_method(sel_getUid("setSelected:"),function(_7,_8,_9){
with(_7){
_9=!!_9;
if(_isSelected===_9){
return;
}
_isSelected=_9;
var _a=objj_msgSend(_7,"view");
if(objj_msgSend(_a,"respondsToSelector:",sel_getUid("setSelected:"))){
objj_msgSend(_a,"setSelected:",objj_msgSend(_7,"isSelected"));
}
}
}),new objj_method(sel_getUid("isSelected"),function(_b,_c){
with(_b){
return _isSelected;
}
}),new objj_method(sel_getUid("collectionView"),function(_d,_e){
with(_d){
return objj_msgSend(_view,"superview");
}
})]);
p;9;CPColor.jt;14567;@STATIC;1.0;I;21;Foundation/CPObject.ji;9;CGColor.ji;17;CPCompatibility.ji;9;CPImage.jt;14473;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("CGColor.j",YES);
objj_executeFile("CPCompatibility.j",YES);
objj_executeFile("CPImage.j",YES);
var _1=0,_2=1,_3=2,_4=3;
var _5=0,_6=1,_7=2;
var _8,_9,_a,_b,_c,_d,_e,_f,_10,_11,_12,_13,_14,_15,_16,_17;
var _18=objj_allocateClassPair(CPObject,"CPColor"),_19=_18.isa;
class_addIvars(_18,[new objj_ivar("_components"),new objj_ivar("_patternImage"),new objj_ivar("_cssString")]);
objj_registerClassPair(_18);
class_addMethods(_18,[new objj_method(sel_getUid("_initWithCSSString:"),function(_1a,_1b,_1c){
with(_1a){
if(_1c.indexOf("rgb")==CPNotFound){
return nil;
}
_1a=objj_msgSendSuper({receiver:_1a,super_class:objj_getClass("CPColor").super_class},"init");
var _1d=_1c.indexOf("(");
var _1e=_1c.substring(_1d+1).split(",");
_components=[parseInt(_1e[0],10)/255,parseInt(_1e[1],10)/255,parseInt(_1e[2],10)/255,_1e[3]?parseInt(_1e[3],10)/255:1];
_cssString=_1c;
return _1a;
}
}),new objj_method(sel_getUid("_initWithRGBA:"),function(_1f,_20,_21){
with(_1f){
_1f=objj_msgSendSuper({receiver:_1f,super_class:objj_getClass("CPColor").super_class},"init");
if(_1f){
_components=_21;
if(!CPFeatureIsCompatible(CPCSSRGBAFeature)&&_components[3]!=1&&window.Base64&&window.CRC32){
var _22=[137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,3,0,0,0,40,203,52,187,0,0,3,0,80,76,84,69,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,137,153,85,0,0,0,1,116,82,78,83,0,64,230,216,102,0,0,0,16,73,68,65,84,120,218,98,96,0,0,0,0,255,255,3,0,0,2,0,1,36,127,36,241,0,0,0,0,73,69,78,68,174,66,96,130,255];
var _23=41;
var _24=42;
var _25=43;
var _26=821;
var _27=809;
var _28=822;
var _29=37;
var _2a=817;
_22[_23]=Math.round(_components[0]*255);
_22[_24]=Math.round(_components[1]*255);
_22[_25]=Math.round(_components[2]*255);
_22[_26]=Math.round(_components[3]*255);
var _2b=_2c(CRC32.getCRC(_22,_29,4+768),4);
var _2d=_2c(CRC32.getCRC(_22,_2a,4+1),4);
for(var i=0;i<4;i++){
_22[_27+i]=_2b[i];
_22[_28+i]=_2d[i];
}
var _2e=Base64.encode(_22);
_cssString="url(\"data:image/png;base64,"+_2e+"\")";
}else{
var _2f=CPFeatureIsCompatible(CPCSSRGBAFeature)&&_components[3]!=1;
_cssString=(_2f?"rgba(":"rgb(")+parseInt(_components[0]*255)+", "+parseInt(_components[1]*255)+", "+parseInt(_components[2]*255)+(_2f?(", "+_components[3]):"")+")";
}
}
return _1f;
}
}),new objj_method(sel_getUid("_initWithPatternImage:"),function(_30,_31,_32){
with(_30){
_30=objj_msgSendSuper({receiver:_30,super_class:objj_getClass("CPColor").super_class},"init");
if(_30){
_patternImage=_32;
_cssString="url(\""+objj_msgSend(_patternImage,"filename")+"\")";
}
return _30;
}
}),new objj_method(sel_getUid("patternImage"),function(_33,_34){
with(_33){
return _patternImage;
}
}),new objj_method(sel_getUid("alphaComponent"),function(_35,_36){
with(_35){
return _components[3];
}
}),new objj_method(sel_getUid("blueComponent"),function(_37,_38){
with(_37){
return _components[2];
}
}),new objj_method(sel_getUid("greenComponent"),function(_39,_3a){
with(_39){
return _components[1];
}
}),new objj_method(sel_getUid("redComponent"),function(_3b,_3c){
with(_3b){
return _components[0];
}
}),new objj_method(sel_getUid("components"),function(_3d,_3e){
with(_3d){
return _components;
}
}),new objj_method(sel_getUid("colorWithAlphaComponent:"),function(_3f,_40,_41){
with(_3f){
var _42=_components.slice();
_42[_42.length-1]=_41;
return objj_msgSend(objj_msgSend(objj_msgSend(_3f,"class"),"alloc"),"_initWithRGBA:",_42);
}
}),new objj_method(sel_getUid("hsbComponents"),function(_43,_44){
with(_43){
var red=ROUND(_components[_1]*255),_45=ROUND(_components[_2]*255),_46=ROUND(_components[_3]*255);
var max=MAX(red,_45,_46),min=MIN(red,_45,_46),_47=max-min;
var _48=max/255,_49=(max!=0)?_47/max:0;
var hue;
if(_49==0){
hue=0;
}else{
var rr=(max-red)/_47;
var gr=(max-_45)/_47;
var br=(max-_46)/_47;
if(red==max){
hue=br-gr;
}else{
if(_45==max){
hue=2+rr-br;
}else{
hue=4+gr-rr;
}
}
hue/=6;
if(hue<0){
hue++;
}
}
return [ROUND(hue*360),ROUND(_49*100),ROUND(_48*100)];
}
}),new objj_method(sel_getUid("cssString"),function(_4a,_4b){
with(_4a){
return _cssString;
}
}),new objj_method(sel_getUid("hexString"),function(_4c,_4d){
with(_4c){
return _4e(objj_msgSend(_4c,"redComponent"),objj_msgSend(_4c,"greenComponent"),objj_msgSend(_4c,"blueComponent"));
}
}),new objj_method(sel_getUid("isEqual:"),function(_4f,_50,_51){
with(_4f){
if(!_51){
return NO;
}
if(_51===_4f){
return YES;
}
return objj_msgSend(_51,"isKindOfClass:",CPColor)&&objj_msgSend(_51,"cssString")===objj_msgSend(_4f,"cssString");
}
}),new objj_method(sel_getUid("description"),function(_52,_53){
with(_52){
return objj_msgSendSuper({receiver:_52,super_class:objj_getClass("CPColor").super_class},"description")+" "+objj_msgSend(_52,"cssString");
}
})]);
class_addMethods(_19,[new objj_method(sel_getUid("colorWithRed:green:blue:alpha:"),function(_54,_55,red,_56,_57,_58){
with(_54){
return objj_msgSend(objj_msgSend(CPColor,"alloc"),"_initWithRGBA:",[red,_56,_57,_58]);
}
}),new objj_method(sel_getUid("colorWithCalibratedRed:green:blue:alpha:"),function(_59,_5a,red,_5b,_5c,_5d){
with(_59){
return objj_msgSend(_59,"colorWithRed:green:blue:alpha:",red,_5b,_5c,_5d);
}
}),new objj_method(sel_getUid("colorWithWhite:alpha:"),function(_5e,_5f,_60,_61){
with(_5e){
return objj_msgSend(objj_msgSend(CPColor,"alloc"),"_initWithRGBA:",[_60,_60,_60,_61]);
}
}),new objj_method(sel_getUid("colorWithCalibratedWhite:alpha:"),function(_62,_63,_64,_65){
with(_62){
return objj_msgSend(_62,"colorWithWhite:alpha:",_64,_65);
}
}),new objj_method(sel_getUid("colorWithHue:saturation:brightness:"),function(_66,_67,hue,_68,_69){
with(_66){
return objj_msgSend(_66,"colorWithHue:saturation:brightness:alpha:",hue,_68,_69,1);
}
}),new objj_method(sel_getUid("colorWithHue:saturation:brightness:alpha:"),function(_6a,_6b,hue,_6c,_6d,_6e){
with(_6a){
if(_6c===0){
return objj_msgSend(CPColor,"colorWithCalibratedWhite:alpha:",_6d/100,_6e);
}
var f=hue%60,p=(_6d*(100-_6c))/10000,q=(_6d*(6000-_6c*f))/600000,t=(_6d*(6000-_6c*(60-f)))/600000,b=_6d/100;
switch(FLOOR(hue/60)){
case 0:
return objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",b,t,p,_6e);
case 1:
return objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",q,b,p,_6e);
case 2:
return objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",p,b,t,_6e);
case 3:
return objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",p,q,b,_6e);
case 4:
return objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",t,p,b,_6e);
case 5:
return objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",b,p,q,_6e);
}
}
}),new objj_method(sel_getUid("colorWithHexString:"),function(_6f,_70,hex){
with(_6f){
return objj_msgSend(objj_msgSend(CPColor,"alloc"),"_initWithRGBA:",_71(hex));
}
}),new objj_method(sel_getUid("blackColor"),function(_72,_73){
with(_72){
if(!_8){
_8=objj_msgSend(objj_msgSend(CPColor,"alloc"),"_initWithRGBA:",[0,0,0,1]);
}
return _8;
}
}),new objj_method(sel_getUid("blueColor"),function(_74,_75){
with(_74){
if(!_b){
_b=objj_msgSend(objj_msgSend(CPColor,"alloc"),"_initWithRGBA:",[0,0,1,1]);
}
return _b;
}
}),new objj_method(sel_getUid("darkGrayColor"),function(_76,_77){
with(_76){
if(!_f){
_f=objj_msgSend(CPColor,"colorWithCalibratedWhite:alpha:",1/3,1);
}
return _f;
}
}),new objj_method(sel_getUid("grayColor"),function(_78,_79){
with(_78){
if(!_d){
_d=objj_msgSend(CPColor,"colorWithCalibratedWhite:alpha:",0.5,1);
}
return _d;
}
}),new objj_method(sel_getUid("greenColor"),function(_7a,_7b){
with(_7a){
if(!_a){
_a=objj_msgSend(objj_msgSend(CPColor,"alloc"),"_initWithRGBA:",[0,1,0,1]);
}
return _a;
}
}),new objj_method(sel_getUid("lightGrayColor"),function(_7c,_7d){
with(_7c){
if(!_e){
_e=objj_msgSend(CPColor,"colorWithCalibratedWhite:alpha:",2/3,1);
}
return _e;
}
}),new objj_method(sel_getUid("redColor"),function(_7e,_7f){
with(_7e){
if(!_9){
_9=objj_msgSend(objj_msgSend(CPColor,"alloc"),"_initWithRGBA:",[1,0,0,1]);
}
return _9;
}
}),new objj_method(sel_getUid("whiteColor"),function(_80,_81){
with(_80){
if(!_10){
_10=objj_msgSend(objj_msgSend(CPColor,"alloc"),"_initWithRGBA:",[1,1,1,1]);
}
return _10;
}
}),new objj_method(sel_getUid("yellowColor"),function(_82,_83){
with(_82){
if(!_c){
_c=objj_msgSend(objj_msgSend(CPColor,"alloc"),"_initWithRGBA:",[1,1,0,1]);
}
return _c;
}
}),new objj_method(sel_getUid("brownColor"),function(_84,_85){
with(_84){
if(!_11){
_11=objj_msgSend(objj_msgSend(CPColor,"alloc"),"_initWithRGBA:",[0.6,0.4,0.2,1]);
}
return _11;
}
}),new objj_method(sel_getUid("cyanColor"),function(_86,_87){
with(_86){
if(!_12){
_12=objj_msgSend(objj_msgSend(CPColor,"alloc"),"_initWithRGBA:",[0,1,1,1]);
}
return _12;
}
}),new objj_method(sel_getUid("magentaColor"),function(_88,_89){
with(_88){
if(!_13){
_13=objj_msgSend(objj_msgSend(CPColor,"alloc"),"_initWithRGBA:",[1,0,1,1]);
}
return _13;
}
}),new objj_method(sel_getUid("orangeColor"),function(_8a,_8b){
with(_8a){
if(!_14){
_14=objj_msgSend(objj_msgSend(CPColor,"alloc"),"_initWithRGBA:",[1,0.5,0,1]);
}
return _14;
}
}),new objj_method(sel_getUid("purpleColor"),function(_8c,_8d){
with(_8c){
if(!_15){
_15=objj_msgSend(objj_msgSend(CPColor,"alloc"),"_initWithRGBA:",[0.5,0,0.5,1]);
}
return _15;
}
}),new objj_method(sel_getUid("shadowColor"),function(_8e,_8f){
with(_8e){
if(!_16){
_16=objj_msgSend(objj_msgSend(CPColor,"alloc"),"_initWithRGBA:",[0,0,0,1/3]);
}
return _16;
}
}),new objj_method(sel_getUid("clearColor"),function(_90,_91){
with(_90){
if(!_17){
_17=objj_msgSend(_90,"colorWithCalibratedWhite:alpha:",0,0);
}
return _17;
}
}),new objj_method(sel_getUid("alternateSelectedControlColor"),function(_92,_93){
with(_92){
return objj_msgSend(objj_msgSend(CPColor,"alloc"),"_initWithRGBA:",[0.22,0.46,0.84,1]);
}
}),new objj_method(sel_getUid("secondarySelectedControlColor"),function(_94,_95){
with(_94){
return objj_msgSend(objj_msgSend(CPColor,"alloc"),"_initWithRGBA:",[0.83,0.83,0.83,1]);
}
}),new objj_method(sel_getUid("colorWithPatternImage:"),function(_96,_97,_98){
with(_96){
return objj_msgSend(objj_msgSend(CPColor,"alloc"),"_initWithPatternImage:",_98);
}
}),new objj_method(sel_getUid("colorWithCSSString:"),function(_99,_9a,_9b){
with(_99){
return objj_msgSend(objj_msgSend(CPColor,"alloc"),"_initWithCSSString:",_9b);
}
})]);
var _18=objj_getClass("CPColor");
if(!_18){
throw new SyntaxError("*** Could not find definition for class \"CPColor\"");
}
var _19=_18.isa;
class_addMethods(_18,[new objj_method(sel_getUid("set"),function(_9c,_9d){
with(_9c){
objj_msgSend(_9c,"setFill");
objj_msgSend(_9c,"setStroke");
}
}),new objj_method(sel_getUid("setFill"),function(_9e,_9f){
with(_9e){
var ctx=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort");
CGContextSetFillColor(ctx,_9e);
}
}),new objj_method(sel_getUid("setStroke"),function(_a0,_a1){
with(_a0){
var ctx=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort");
CGContextSetStrokeColor(ctx,_a0);
}
})]);
var _18=objj_getClass("CPColor");
if(!_18){
throw new SyntaxError("*** Could not find definition for class \"CPColor\"");
}
var _19=_18.isa;
class_addMethods(_19,[new objj_method(sel_getUid("randomColor"),function(_a2,_a3){
with(_a2){
return objj_msgSend(CPColor,"colorWithRed:green:blue:alpha:",RAND(),RAND(),RAND(),1);
}
})]);
var _a4="CPColorComponentsKey",_a5="CPColorPatternImageKey";
var _18=objj_getClass("CPColor");
if(!_18){
throw new SyntaxError("*** Could not find definition for class \"CPColor\"");
}
var _19=_18.isa;
class_addMethods(_18,[new objj_method(sel_getUid("initWithCoder:"),function(_a6,_a7,_a8){
with(_a6){
if(objj_msgSend(_a8,"containsValueForKey:",_a5)){
return objj_msgSend(_a6,"_initWithPatternImage:",objj_msgSend(_a8,"decodeObjectForKey:",_a5));
}
return objj_msgSend(_a6,"_initWithRGBA:",objj_msgSend(_a8,"decodeObjectForKey:",_a4));
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_a9,_aa,_ab){
with(_a9){
if(_patternImage){
objj_msgSend(_ab,"encodeObject:forKey:",_patternImage,_a5);
}else{
objj_msgSend(_ab,"encodeObject:forKey:",_components,_a4);
}
}
})]);
var _ac="0123456789ABCDEF";
var _71,_2c,_4e,_ad;
_71=function(hex){
if(hex.length==3){
hex=hex.charAt(0)+hex.charAt(0)+hex.charAt(1)+hex.charAt(1)+hex.charAt(2)+hex.charAt(2);
}
if(hex.length!=6){
return null;
}
hex=hex.toUpperCase();
for(var i=0;i<hex.length;i++){
if(_ac.indexOf(hex.charAt(i))==-1){
return null;
}
}
var red=(_ac.indexOf(hex.charAt(0))*16+_ac.indexOf(hex.charAt(1)))/255;
var _ae=(_ac.indexOf(hex.charAt(2))*16+_ac.indexOf(hex.charAt(3)))/255;
var _af=(_ac.indexOf(hex.charAt(4))*16+_ac.indexOf(hex.charAt(5)))/255;
return [red,_ae,_af,1];
};
_2c=function(_b0,_b1){
if(!_b1){
_b1=(_b0==0)?1:Math.round((Math.log(_b0)/Math.log(2))/8+0.5);
}
var _b2=new Array(_b1);
for(var i=_b1-1;i>=0;i--){
_b2[i]=_b0&255;
_b0=_b0>>8;
}
return _b2;
};
_4e=function(r,g,b){
return _ad(r)+_ad(g)+_ad(b);
};
_ad=function(n){
if(!n||isNaN(n)){
return "00";
}
n=ROUND(MIN(255,MAX(0,256*n)));
return _ac.charAt((n-n%16)/16)+_ac.charAt(n%16);
};
p;14;CPColorPanel.jt;16850;@STATIC;1.0;i;10;CPButton.ji;10;CPCookie.ji;9;CPPanel.ji;8;CPView.ji;15;CPColorPicker.ji;21;CPSliderColorPicker.jt;16729;
objj_executeFile("CPButton.j",YES);
objj_executeFile("CPCookie.j",YES);
objj_executeFile("CPPanel.j",YES);
objj_executeFile("CPView.j",YES);
CPColorPanelColorDidChangeNotification="CPColorPanelColorDidChangeNotification";
var _1=20,_2=32,_3=14,_4=32,_5=12;
var _6=nil,_7=[];
CPWheelColorPickerMode=1;
CPSliderColorPickerMode=2;
CPColorPickerViewWidth=265,CPColorPickerViewHeight=370;
var _8=objj_allocateClassPair(CPPanel,"CPColorPanel"),_9=_8.isa;
class_addIvars(_8,[new objj_ivar("_toolbar"),new objj_ivar("_swatchView"),new objj_ivar("_previewView"),new objj_ivar("_opacitySlider"),new objj_ivar("_colorPickers"),new objj_ivar("_currentView"),new objj_ivar("_activePicker"),new objj_ivar("_color"),new objj_ivar("_target"),new objj_ivar("_action"),new objj_ivar("_mode")]);
objj_registerClassPair(_8);
class_addMethods(_8,[new objj_method(sel_getUid("init"),function(_a,_b){
with(_a){
_a=objj_msgSendSuper({receiver:_a,super_class:objj_getClass("CPColorPanel").super_class},"initWithContentRect:styleMask:",CGRectMake(500,50,219,370),(CPTitledWindowMask|CPClosableWindowMask|CPResizableWindowMask));
if(_a){
objj_msgSend(objj_msgSend(_a,"contentView"),"setBackgroundColor:",objj_msgSend(CPColor,"colorWithWhite:alpha:",0.95,1));
objj_msgSend(_a,"setTitle:","Color Panel");
objj_msgSend(_a,"setLevel:",CPFloatingWindowLevel);
objj_msgSend(_a,"setFloatingPanel:",YES);
objj_msgSend(_a,"setBecomesKeyOnlyIfNeeded:",YES);
objj_msgSend(_a,"setMinSize:",CGSizeMake(219,342));
objj_msgSend(_a,"setMaxSize:",CGSizeMake(323,537));
}
return _a;
}
}),new objj_method(sel_getUid("setColor:"),function(_c,_d,_e){
with(_c){
_color=_e;
objj_msgSend(_previewView,"setBackgroundColor:",_color);
objj_msgSend(CPApp,"sendAction:to:from:",sel_getUid("changeColor:"),nil,_c);
if(_target&&_action){
objj_msgSend(CPApp,"sendAction:to:from:",_action,_target,_c);
}
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPColorPanelColorDidChangeNotification,_c);
objj_msgSend(_activePicker,"setColor:",_color);
objj_msgSend(_opacitySlider,"setFloatValue:",objj_msgSend(_color,"alphaComponent"));
}
}),new objj_method(sel_getUid("setColor:updatePicker:"),function(_f,_10,_11,_12){
with(_f){
objj_msgSend(_f,"setColor:",_11);
if(_12){
objj_msgSend(_activePicker,"setColor:",_color);
}
}
}),new objj_method(sel_getUid("color"),function(_13,_14){
with(_13){
return _color;
}
}),new objj_method(sel_getUid("opacity"),function(_15,_16){
with(_15){
return objj_msgSend(_opacitySlider,"floatValue");
}
}),new objj_method(sel_getUid("setTarget:"),function(_17,_18,_19){
with(_17){
_target=_19;
}
}),new objj_method(sel_getUid("target"),function(_1a,_1b){
with(_1a){
return _target;
}
}),new objj_method(sel_getUid("setAction:"),function(_1c,_1d,_1e){
with(_1c){
_action=_1e;
}
}),new objj_method(sel_getUid("action"),function(_1f,_20){
with(_1f){
return _action;
}
}),new objj_method(sel_getUid("setMode:"),function(_21,_22,_23){
with(_21){
_mode=_23;
}
}),new objj_method(sel_getUid("_setPicker:"),function(_24,_25,_26){
with(_24){
var _27=_colorPickers[objj_msgSend(_26,"tag")],_28=objj_msgSend(_27,"provideNewView:",NO);
if(!_28){
_28=objj_msgSend(_27,"provideNewView:",YES);
}
if(_28==_currentView){
return;
}
if(_currentView){
objj_msgSend(_28,"setFrame:",objj_msgSend(_currentView,"frame"));
}else{
var _29=(_2+10+_1+5+_3+32),_2a=objj_msgSend(objj_msgSend(_24,"contentView"),"bounds");
objj_msgSend(_28,"setFrameSize:",CPSizeMake(_2a.size.width-10,_2a.size.height-_29));
objj_msgSend(_28,"setFrameOrigin:",CPPointMake(5,_29));
}
objj_msgSend(_currentView,"removeFromSuperview");
objj_msgSend(objj_msgSend(_24,"contentView"),"addSubview:",_28);
_currentView=_28;
_activePicker=_27;
objj_msgSend(_27,"setColor:",objj_msgSend(_24,"color"));
}
}),new objj_method(sel_getUid("mode"),function(_2b,_2c){
with(_2b){
return _mode;
}
}),new objj_method(sel_getUid("orderFront:"),function(_2d,_2e,_2f){
with(_2d){
objj_msgSend(_2d,"_loadContentsIfNecessary");
objj_msgSendSuper({receiver:_2d,super_class:objj_getClass("CPColorPanel").super_class},"orderFront:",_2f);
}
}),new objj_method(sel_getUid("_loadContentsIfNecessary"),function(_30,_31){
with(_30){
if(_toolbar){
return;
}
if(!_color){
_color=objj_msgSend(CPColor,"whiteColor");
}
_colorPickers=[];
var _32=objj_msgSend(_7,"count");
for(var i=0;i<_32;i++){
var _33=_7[i],_34=objj_msgSend(objj_msgSend(_33,"alloc"),"initWithPickerMask:colorPanel:",0,_30);
_colorPickers.push(_34);
}
var _35=objj_msgSend(_30,"contentView"),_36=objj_msgSend(_35,"bounds");
_toolbar=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMake(0,6,CGRectGetWidth(_36),_2));
objj_msgSend(_toolbar,"setAutoresizingMask:",CPViewWidthSizable);
var _37=_32*_4+(_32-1)*_5,_38=(CGRectGetWidth(_36)-_37)/2,_39=nil;
for(var i=0;i<_32;i++){
var _3a=objj_msgSend(_colorPickers[i],"provideNewButtonImage"),_3b=objj_msgSend(_colorPickers[i],"provideNewAlternateButtonImage"),_3c=objj_msgSend(objj_msgSend(CPButton,"alloc"),"initWithFrame:",CGRectMake(_38+i*(_4+_5),0,_4,_4));
objj_msgSend(_3c,"setTag:",i);
objj_msgSend(_3c,"setTarget:",_30);
objj_msgSend(_3c,"setAction:",sel_getUid("_setPicker:"));
objj_msgSend(_3c,"setBordered:",NO);
objj_msgSend(_3c,"setAutoresizingMask:",CPViewMinXMargin|CPViewMaxXMargin);
objj_msgSend(_3c,"setImage:",_3a);
objj_msgSend(_3c,"setAlternateImage:",_3b);
objj_msgSend(_toolbar,"addSubview:",_3c);
if(!_39){
_39=_3c;
}
}
var _3d=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMake(76,_2+10,CGRectGetWidth(_36)-86,_1));
_previewView=objj_msgSend(objj_msgSend(_CPColorPanelPreview,"alloc"),"initWithFrame:",CGRectInset(objj_msgSend(_3d,"bounds"),2,2));
objj_msgSend(_previewView,"setColorPanel:",_30);
objj_msgSend(_previewView,"setAutoresizingMask:",CPViewWidthSizable);
objj_msgSend(_3d,"setBackgroundColor:",objj_msgSend(CPColor,"colorWithWhite:alpha:",0.8,1));
objj_msgSend(_3d,"setAutoresizingMask:",CPViewWidthSizable);
objj_msgSend(_3d,"addSubview:",_previewView);
var _3e=objj_msgSend(objj_msgSend(CPTextField,"alloc"),"initWithFrame:",CPRectMake(10,_2+10,60,15));
objj_msgSend(_3e,"setStringValue:","Preview:");
objj_msgSend(_3e,"setTextColor:",objj_msgSend(CPColor,"blackColor"));
objj_msgSend(_3e,"setAlignment:",CPRightTextAlignment);
var _3f=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMake(76,_2+10+_1+5,CGRectGetWidth(_36)-86,_3+2));
objj_msgSend(_3f,"setBackgroundColor:",objj_msgSend(CPColor,"colorWithWhite:alpha:",0.8,1));
objj_msgSend(_3f,"setAutoresizingMask:",CPViewWidthSizable);
_swatchView=objj_msgSend(objj_msgSend(_CPColorPanelSwatches,"alloc"),"initWithFrame:",CGRectInset(objj_msgSend(_3f,"bounds"),1,1));
objj_msgSend(_swatchView,"setColorPanel:",_30);
objj_msgSend(_swatchView,"setAutoresizingMask:",CPViewWidthSizable);
objj_msgSend(_3f,"addSubview:",_swatchView);
var _40=objj_msgSend(objj_msgSend(CPTextField,"alloc"),"initWithFrame:",CPRectMake(10,_2+8+_1+6,60,15));
objj_msgSend(_40,"setStringValue:","Swatches:");
objj_msgSend(_40,"setTextColor:",objj_msgSend(CPColor,"blackColor"));
objj_msgSend(_40,"setAlignment:",CPRightTextAlignment);
var _41=objj_msgSend(objj_msgSend(CPTextField,"alloc"),"initWithFrame:",CPRectMake(10,_2+_1+35,60,20));
objj_msgSend(_41,"setStringValue:","Opacity:");
objj_msgSend(_41,"setTextColor:",objj_msgSend(CPColor,"blackColor"));
objj_msgSend(_41,"setAlignment:",CPRightTextAlignment);
_opacitySlider=objj_msgSend(objj_msgSend(CPSlider,"alloc"),"initWithFrame:",CGRectMake(76,_2+_1+34,CGRectGetWidth(_36)-86,20));
objj_msgSend(_opacitySlider,"setMinValue:",0);
objj_msgSend(_opacitySlider,"setMaxValue:",1);
objj_msgSend(_opacitySlider,"setTarget:",_30);
objj_msgSend(_opacitySlider,"setAction:",sel_getUid("setOpacity:"));
objj_msgSend(_35,"addSubview:",_toolbar);
objj_msgSend(_35,"addSubview:",_3d);
objj_msgSend(_35,"addSubview:",_3e);
objj_msgSend(_35,"addSubview:",_3f);
objj_msgSend(_35,"addSubview:",_40);
objj_msgSend(_35,"addSubview:",_41);
objj_msgSend(_35,"addSubview:",_opacitySlider);
_target=nil;
_action=nil;
_activePicker=nil;
objj_msgSend(_previewView,"setBackgroundColor:",_color);
if(_39){
objj_msgSend(_30,"_setPicker:",_39);
}
}
}),new objj_method(sel_getUid("setOpacity:"),function(_42,_43,_44){
with(_42){
var _45=objj_msgSend(objj_msgSend(_42,"color"),"components"),_46=objj_msgSend(_44,"floatValue");
objj_msgSend(_42,"setColor:updatePicker:",objj_msgSend(_color,"colorWithAlphaComponent:",_46),YES);
}
})]);
class_addMethods(_9,[new objj_method(sel_getUid("provideColorPickerClass:"),function(_47,_48,_49){
with(_47){
_7.push(_49);
}
}),new objj_method(sel_getUid("sharedColorPanel"),function(_4a,_4b){
with(_4a){
if(!_6){
_6=objj_msgSend(objj_msgSend(CPColorPanel,"alloc"),"init");
}
return _6;
}
}),new objj_method(sel_getUid("setPickerMode:"),function(_4c,_4d,_4e){
with(_4c){
var _4f=objj_msgSend(CPColorPanel,"sharedColorPanel");
objj_msgSend(_4f,"setMode:",_4e);
}
})]);
CPColorDragType="CPColorDragType";
var _50="CPColorPanelSwatchesCookie";
var _8=objj_allocateClassPair(CPView,"_CPColorPanelSwatches"),_9=_8.isa;
class_addIvars(_8,[new objj_ivar("_swatches"),new objj_ivar("_dragColor"),new objj_ivar("_colorPanel"),new objj_ivar("_swatchCookie")]);
objj_registerClassPair(_8);
class_addMethods(_8,[new objj_method(sel_getUid("initWithFrame:"),function(_51,_52,_53){
with(_51){
_51=objj_msgSendSuper({receiver:_51,super_class:objj_getClass("_CPColorPanelSwatches").super_class},"initWithFrame:",_53);
objj_msgSend(_51,"setBackgroundColor:",objj_msgSend(CPColor,"grayColor"));
objj_msgSend(_51,"registerForDraggedTypes:",objj_msgSend(CPArray,"arrayWithObjects:",CPColorDragType));
var _54=objj_msgSend(CPColor,"whiteColor");
_swatchCookie=objj_msgSend(objj_msgSend(CPCookie,"alloc"),"initWithName:",_50);
var _55=objj_msgSend(_51,"startingColorList");
_swatches=[];
for(var i=0;i<50;i++){
var _56=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CPRectMake(13*i+1,1,12,12)),_57=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectInset(objj_msgSend(_56,"bounds"),1,1));
objj_msgSend(_56,"setBackgroundColor:",_54);
objj_msgSend(_57,"setBackgroundColor:",(i<_55.length)?_55[i]:_54);
objj_msgSend(_56,"addSubview:",_57);
objj_msgSend(_51,"addSubview:",_56);
_swatches.push(_56);
}
return _51;
}
}),new objj_method(sel_getUid("isOpaque"),function(_58,_59){
with(_58){
return YES;
}
}),new objj_method(sel_getUid("startingColorList"),function(_5a,_5b){
with(_5a){
var _5c=objj_msgSend(_swatchCookie,"value");
if(_5c==""){
return [objj_msgSend(CPColor,"blackColor"),objj_msgSend(CPColor,"darkGrayColor"),objj_msgSend(CPColor,"grayColor"),objj_msgSend(CPColor,"lightGrayColor"),objj_msgSend(CPColor,"whiteColor"),objj_msgSend(CPColor,"redColor"),objj_msgSend(CPColor,"greenColor"),objj_msgSend(CPColor,"blueColor"),objj_msgSend(CPColor,"yellowColor")];
}
var _5c=eval(_5c);
var _5d=[];
for(var i=0;i<_5c.length;i++){
_5d.push(objj_msgSend(CPColor,"colorWithHexString:",_5c[i]));
}
return _5d;
}
}),new objj_method(sel_getUid("saveColorList"),function(_5e,_5f){
with(_5e){
var _60=[];
for(var i=0;i<_swatches.length;i++){
_60.push(objj_msgSend(objj_msgSend(objj_msgSend(_swatches[i],"subviews")[0],"backgroundColor"),"hexString"));
}
var _61=new Date();
_61.setYear(2019);
objj_msgSend(_swatchCookie,"setValue:expires:domain:",JSON.stringify(_60),_61,nil);
}
}),new objj_method(sel_getUid("setColorPanel:"),function(_62,_63,_64){
with(_62){
_colorPanel=_64;
}
}),new objj_method(sel_getUid("colorPanel"),function(_65,_66){
with(_65){
return _colorPanel;
}
}),new objj_method(sel_getUid("colorAtIndex:"),function(_67,_68,_69){
with(_67){
return objj_msgSend(objj_msgSend(_swatches[_69],"subviews")[0],"backgroundColor");
}
}),new objj_method(sel_getUid("setColor:atIndex:"),function(_6a,_6b,_6c,_6d){
with(_6a){
objj_msgSend(objj_msgSend(_swatches[_6d],"subviews")[0],"setBackgroundColor:",_6c);
objj_msgSend(_6a,"saveColorList");
}
}),new objj_method(sel_getUid("mouseUp:"),function(_6e,_6f,_70){
with(_6e){
var _71=objj_msgSend(_6e,"convertPoint:fromView:",objj_msgSend(_70,"locationInWindow"),nil),_72=objj_msgSend(_6e,"bounds");
if(!CGRectContainsPoint(_72,_71)||_71.x>objj_msgSend(_6e,"bounds").size.width-1||_71.x<1){
return NO;
}
objj_msgSend(_colorPanel,"setColor:updatePicker:",objj_msgSend(_6e,"colorAtIndex:",FLOOR(_71.x/13)),YES);
}
}),new objj_method(sel_getUid("mouseDragged:"),function(_73,_74,_75){
with(_73){
var _76=objj_msgSend(_73,"convertPoint:fromView:",objj_msgSend(_75,"locationInWindow"),nil);
if(_76.x>objj_msgSend(_73,"bounds").size.width-1||_76.x<1){
return NO;
}
objj_msgSend(objj_msgSend(CPPasteboard,"pasteboardWithName:",CPDragPboard),"declareTypes:owner:",objj_msgSend(CPArray,"arrayWithObject:",CPColorDragType),_73);
var _77=_swatches[FLOOR(_76.x/13)];
_dragColor=objj_msgSend(objj_msgSend(_77,"subviews")[0],"backgroundColor");
var _78=CPRectCreateCopy(objj_msgSend(_77,"bounds"));
var _79=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",_78);
dragFillView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectInset(_78,1,1));
objj_msgSend(_79,"setBackgroundColor:",objj_msgSend(CPColor,"blackColor"));
objj_msgSend(dragFillView,"setBackgroundColor:",_dragColor);
objj_msgSend(_79,"addSubview:",dragFillView);
objj_msgSend(_73,"dragView:at:offset:event:pasteboard:source:slideBack:",_79,CPPointMake(_76.x-_78.size.width/2,_76.y-_78.size.height/2),CPPointMake(0,0),_75,nil,_73,YES);
}
}),new objj_method(sel_getUid("pasteboard:provideDataForType:"),function(_7a,_7b,_7c,_7d){
with(_7a){
if(_7d==CPColorDragType){
objj_msgSend(_7c,"setData:forType:",objj_msgSend(CPKeyedArchiver,"archivedDataWithRootObject:",_dragColor),_7d);
}
}
}),new objj_method(sel_getUid("performDragOperation:"),function(_7e,_7f,_80){
with(_7e){
var _81=objj_msgSend(_7e,"convertPoint:fromView:",objj_msgSend(_80,"draggingLocation"),nil),_82=objj_msgSend(_80,"draggingPasteboard"),_83=nil;
if(!objj_msgSend(_82,"availableTypeFromArray:",[CPColorDragType])||_81.x>objj_msgSend(_7e,"bounds").size.width-1||_81.x<1){
return NO;
}
objj_msgSend(_7e,"setColor:atIndex:",objj_msgSend(CPKeyedUnarchiver,"unarchiveObjectWithData:",objj_msgSend(_82,"dataForType:",CPColorDragType)),FLOOR(_81.x/13));
}
})]);
var _8=objj_allocateClassPair(CPView,"_CPColorPanelPreview"),_9=_8.isa;
class_addIvars(_8,[new objj_ivar("_colorPanel")]);
objj_registerClassPair(_8);
class_addMethods(_8,[new objj_method(sel_getUid("initWithFrame:"),function(_84,_85,_86){
with(_84){
_84=objj_msgSendSuper({receiver:_84,super_class:objj_getClass("_CPColorPanelPreview").super_class},"initWithFrame:",_86);
objj_msgSend(_84,"registerForDraggedTypes:",objj_msgSend(CPArray,"arrayWithObjects:",CPColorDragType));
return _84;
}
}),new objj_method(sel_getUid("setColorPanel:"),function(_87,_88,_89){
with(_87){
_colorPanel=_89;
}
}),new objj_method(sel_getUid("colorPanel"),function(_8a,_8b){
with(_8a){
return _colorPanel;
}
}),new objj_method(sel_getUid("performDragOperation:"),function(_8c,_8d,_8e){
with(_8c){
var _8f=objj_msgSend(_8e,"draggingPasteboard");
if(!objj_msgSend(_8f,"availableTypeFromArray:",[CPColorDragType])){
return NO;
}
var _90=objj_msgSend(CPKeyedUnarchiver,"unarchiveObjectWithData:",objj_msgSend(_8f,"dataForType:",CPColorDragType));
objj_msgSend(_colorPanel,"setColor:updatePicker:",_90,YES);
}
}),new objj_method(sel_getUid("isOpaque"),function(_91,_92){
with(_91){
return YES;
}
}),new objj_method(sel_getUid("mouseDragged:"),function(_93,_94,_95){
with(_93){
var _96=objj_msgSend(_93,"convertPoint:fromView:",objj_msgSend(_95,"locationInWindow"),nil);
objj_msgSend(objj_msgSend(CPPasteboard,"pasteboardWithName:",CPDragPboard),"declareTypes:owner:",[CPColorDragType],_93);
var _97=CPRectMake(0,0,15,15);
var _98=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",_97);
dragFillView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectInset(_97,1,1));
objj_msgSend(_98,"setBackgroundColor:",objj_msgSend(CPColor,"blackColor"));
objj_msgSend(dragFillView,"setBackgroundColor:",objj_msgSend(_93,"backgroundColor"));
objj_msgSend(_98,"addSubview:",dragFillView);
objj_msgSend(_93,"dragView:at:offset:event:pasteboard:source:slideBack:",_98,CPPointMake(_96.x-_97.size.width/2,_96.y-_97.size.height/2),CPPointMake(0,0),_95,nil,_93,YES);
}
}),new objj_method(sel_getUid("pasteboard:provideDataForType:"),function(_99,_9a,_9b,_9c){
with(_99){
if(_9c==CPColorDragType){
objj_msgSend(_9b,"setData:forType:",objj_msgSend(CPKeyedArchiver,"archivedDataWithRootObject:",objj_msgSend(_99,"backgroundColor")),_9c);
}
}
})]);
objj_executeFile("CPColorPicker.j",YES);
objj_executeFile("CPSliderColorPicker.j",YES);
objj_msgSend(CPColorPanel,"provideColorPickerClass:",CPColorWheelColorPicker);
objj_msgSend(CPColorPanel,"provideColorPickerClass:",CPSliderColorPicker);
p;15;CPColorPicker.jt;10195;@STATIC;1.0;I;21;Foundation/CPObject.ji;14;CPColorPanel.jt;10130;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("CPColorPanel.j",YES);
var _1=objj_allocateClassPair(CPObject,"CPColorPicker"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_panel"),new objj_ivar("_mask")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithPickerMask:colorPanel:"),function(_3,_4,_5,_6){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPColorPicker").super_class},"init");
_panel=_6;
_mask=_5;
return _3;
}
}),new objj_method(sel_getUid("colorPanel"),function(_7,_8){
with(_7){
return _panel;
}
}),new objj_method(sel_getUid("provideNewButtonImage"),function(_9,_a){
with(_9){
return nil;
}
}),new objj_method(sel_getUid("setMode:"),function(_b,_c,_d){
with(_b){
return;
}
}),new objj_method(sel_getUid("setColor:"),function(_e,_f,_10){
with(_e){
return;
}
})]);
var _1=objj_allocateClassPair(CPColorPicker,"CPColorWheelColorPicker"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_pickerView"),new objj_ivar("_brightnessSlider"),new objj_ivar("_hueSaturationView"),new objj_ivar("_cachedColor")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithPickerMask:colorPanel:"),function(_11,_12,_13,_14){
with(_11){
return objj_msgSendSuper({receiver:_11,super_class:objj_getClass("CPColorWheelColorPicker").super_class},"initWithPickerMask:colorPanel:",_13,_14);
}
}),new objj_method(sel_getUid("initView"),function(_15,_16){
with(_15){
aFrame=CPRectMake(0,0,CPColorPickerViewWidth,CPColorPickerViewHeight);
_pickerView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",aFrame);
objj_msgSend(_pickerView,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
_brightnessSlider=objj_msgSend(objj_msgSend(CPSlider,"alloc"),"initWithFrame:",CGRectMake(0,(aFrame.size.height-34),aFrame.size.width,15));
objj_msgSend(_brightnessSlider,"setValue:forThemeAttribute:",15,"track-width");
objj_msgSend(_brightnessSlider,"setValue:forThemeAttribute:",objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:",objj_msgSend(objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(CPColorPicker,"class")),"pathForResource:","brightness_bar.png"))),"track-color");
objj_msgSend(_brightnessSlider,"setMinValue:",0);
objj_msgSend(_brightnessSlider,"setMaxValue:",100);
objj_msgSend(_brightnessSlider,"setFloatValue:",100);
objj_msgSend(_brightnessSlider,"setTarget:",_15);
objj_msgSend(_brightnessSlider,"setAction:",sel_getUid("brightnessSliderDidChange:"));
objj_msgSend(_brightnessSlider,"setAutoresizingMask:",CPViewWidthSizable|CPViewMinYMargin);
_hueSaturationView=objj_msgSend(objj_msgSend(__CPColorWheel,"alloc"),"initWithFrame:",CPRectMake(0,0,aFrame.size.width,aFrame.size.height-38));
objj_msgSend(_hueSaturationView,"setDelegate:",_15);
objj_msgSend(_hueSaturationView,"setAutoresizingMask:",(CPViewWidthSizable|CPViewHeightSizable));
objj_msgSend(_pickerView,"addSubview:",_hueSaturationView);
objj_msgSend(_pickerView,"addSubview:",_brightnessSlider);
}
}),new objj_method(sel_getUid("brightnessSliderDidChange:"),function(_17,_18,_19){
with(_17){
objj_msgSend(_17,"updateColor");
}
}),new objj_method(sel_getUid("colorWheelDidChange:"),function(_1a,_1b,_1c){
with(_1a){
objj_msgSend(_1a,"updateColor");
}
}),new objj_method(sel_getUid("updateColor"),function(_1d,_1e){
with(_1d){
var hue=objj_msgSend(_hueSaturationView,"angle"),_1f=objj_msgSend(_hueSaturationView,"distance"),_20=objj_msgSend(_brightnessSlider,"floatValue");
objj_msgSend(_hueSaturationView,"setWheelBrightness:",_20/100);
objj_msgSend(_brightnessSlider,"setBackgroundColor:",objj_msgSend(CPColor,"colorWithHue:saturation:brightness:",hue,_1f,100));
var _21=objj_msgSend(_1d,"colorPanel"),_22=objj_msgSend(_21,"opacity");
_cachedColor=objj_msgSend(CPColor,"colorWithHue:saturation:brightness:alpha:",hue,_1f,_20,_22);
objj_msgSend(objj_msgSend(_1d,"colorPanel"),"setColor:",_cachedColor);
}
}),new objj_method(sel_getUid("supportsMode:"),function(_23,_24,_25){
with(_23){
return (_25==CPWheelColorPickerMode)?YES:NO;
}
}),new objj_method(sel_getUid("currentMode"),function(_26,_27){
with(_26){
return CPWheelColorPickerMode;
}
}),new objj_method(sel_getUid("provideNewView:"),function(_28,_29,_2a){
with(_28){
if(_2a){
objj_msgSend(_28,"initView");
}
return _pickerView;
}
}),new objj_method(sel_getUid("setColor:"),function(_2b,_2c,_2d){
with(_2b){
if(objj_msgSend(_2d,"isEqual:",_cachedColor)){
return;
}
var hsb=objj_msgSend(_2d,"hsbComponents");
objj_msgSend(_hueSaturationView,"setPositionToColor:",_2d);
objj_msgSend(_brightnessSlider,"setFloatValue:",hsb[2]);
objj_msgSend(_hueSaturationView,"setWheelBrightness:",hsb[2]/100);
objj_msgSend(_brightnessSlider,"setBackgroundColor:",objj_msgSend(CPColor,"colorWithHue:saturation:brightness:",hsb[0],hsb[1],100));
}
}),new objj_method(sel_getUid("provideNewButtonImage"),function(_2e,_2f){
with(_2e){
return objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(objj_msgSend(CPBundle,"bundleForClass:",CPColorPicker),"pathForResource:","wheel_button.png"),CGSizeMake(32,32));
}
}),new objj_method(sel_getUid("provideNewAlternateButtonImage"),function(_30,_31){
with(_30){
return objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(objj_msgSend(CPBundle,"bundleForClass:",CPColorPicker),"pathForResource:","wheel_button_h.png"),CGSizeMake(32,32));
}
})]);
var _1=objj_allocateClassPair(CPView,"__CPColorWheel"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_wheelImage"),new objj_ivar("_blackWheelImage"),new objj_ivar("_crosshair"),new objj_ivar("_delegate"),new objj_ivar("_angle"),new objj_ivar("_distance"),new objj_ivar("_radius")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithFrame:"),function(_32,_33,_34){
with(_32){
_32=objj_msgSendSuper({receiver:_32,super_class:objj_getClass("__CPColorWheel").super_class},"initWithFrame:",_34);
var _35=objj_msgSend(objj_msgSend(CPBundle,"bundleForClass:",CPColorPicker),"pathForResource:","wheel.png");
_wheelImage=new Image();
_wheelImage.src=_35;
_wheelImage.style.position="absolute";
_35=objj_msgSend(objj_msgSend(CPBundle,"bundleForClass:",CPColorPicker),"pathForResource:","wheel_black.png");
_blackWheelImage=new Image();
_blackWheelImage.src=_35;
_blackWheelImage.style.opacity="0";
_blackWheelImage.style.filter="alpha(opacity=0)";
_blackWheelImage.style.position="absolute";
_DOMElement.appendChild(_wheelImage);
_DOMElement.appendChild(_blackWheelImage);
objj_msgSend(_32,"setWheelSize:",_34.size);
_crosshair=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CPRectMake(_radius-2,_radius-2,4,4));
objj_msgSend(_crosshair,"setBackgroundColor:",objj_msgSend(CPColor,"blackColor"));
var _36=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectInset(objj_msgSend(_crosshair,"bounds"),1,1));
objj_msgSend(_36,"setBackgroundColor:",objj_msgSend(CPColor,"whiteColor"));
objj_msgSend(_crosshair,"addSubview:",_36);
objj_msgSend(_32,"addSubview:",_crosshair);
return _32;
}
}),new objj_method(sel_getUid("setWheelBrightness:"),function(_37,_38,_39){
with(_37){
_blackWheelImage.style.opacity=1-_39;
_blackWheelImage.style.filter="alpha(opacity="+(1-_39)*100+")";
}
}),new objj_method(sel_getUid("setFrameSize:"),function(_3a,_3b,_3c){
with(_3a){
objj_msgSendSuper({receiver:_3a,super_class:objj_getClass("__CPColorWheel").super_class},"setFrameSize:",_3c);
objj_msgSend(_3a,"setWheelSize:",_3c);
}
}),new objj_method(sel_getUid("setWheelSize:"),function(_3d,_3e,_3f){
with(_3d){
var min=MIN(_3f.width,_3f.height);
_blackWheelImage.style.width=min;
_blackWheelImage.style.height=min;
_blackWheelImage.width=min;
_blackWheelImage.height=min;
_blackWheelImage.style.top=(_3f.height-min)/2+"px";
_blackWheelImage.style.left=(_3f.width-min)/2+"px";
_wheelImage.style.width=min;
_wheelImage.style.height=min;
_wheelImage.width=min;
_wheelImage.height=min;
_wheelImage.style.top=(_3f.height-min)/2+"px";
_wheelImage.style.left=(_3f.width-min)/2+"px";
_radius=min/2;
objj_msgSend(_3d,"setAngle:distance:",objj_msgSend(_3d,"degreesToRadians:",_angle),(_distance/100)*_radius);
}
}),new objj_method(sel_getUid("setDelegate:"),function(_40,_41,_42){
with(_40){
_delegate=_42;
}
}),new objj_method(sel_getUid("delegate"),function(_43,_44){
with(_43){
return _delegate;
}
}),new objj_method(sel_getUid("angle"),function(_45,_46){
with(_45){
return _angle;
}
}),new objj_method(sel_getUid("distance"),function(_47,_48){
with(_47){
return _distance;
}
}),new objj_method(sel_getUid("mouseDown:"),function(_49,_4a,_4b){
with(_49){
objj_msgSend(_49,"reposition:",_4b);
}
}),new objj_method(sel_getUid("mouseDragged:"),function(_4c,_4d,_4e){
with(_4c){
objj_msgSend(_4c,"reposition:",_4e);
}
}),new objj_method(sel_getUid("reposition:"),function(_4f,_50,_51){
with(_4f){
var _52=objj_msgSend(_4f,"bounds"),_53=objj_msgSend(_4f,"convertPoint:fromView:",objj_msgSend(_51,"locationInWindow"),nil);
var _54=CGRectGetMidX(_52);
var _55=CGRectGetMidY(_52);
var _56=MIN(SQRT((_53.x-_54)*(_53.x-_54)+(_53.y-_55)*(_53.y-_55)),_radius);
var _57=ATAN2(_53.y-_55,_53.x-_54);
objj_msgSend(_4f,"setAngle:distance:",_57,_56);
objj_msgSend(_delegate,"colorWheelDidChange:",_4f);
}
}),new objj_method(sel_getUid("setAngle:distance:"),function(_58,_59,_5a,_5b){
with(_58){
var _5c=objj_msgSend(_58,"bounds");
var _5d=CGRectGetMidX(_5c);
var _5e=CGRectGetMidY(_5c);
_angle=objj_msgSend(_58,"radiansToDegrees:",_5a);
_distance=(_5b/_radius)*100;
objj_msgSend(_crosshair,"setFrameOrigin:",CPPointMake(COS(_5a)*_5b+_5d-2,SIN(_5a)*_5b+_5e-2));
}
}),new objj_method(sel_getUid("setPositionToColor:"),function(_5f,_60,_61){
with(_5f){
var hsb=objj_msgSend(_61,"hsbComponents"),_62=objj_msgSend(_5f,"bounds");
var _63=objj_msgSend(_5f,"degreesToRadians:",hsb[0]),_64=(hsb[1]/100)*_radius;
objj_msgSend(_5f,"setAngle:distance:",_63,_64);
}
}),new objj_method(sel_getUid("radiansToDegrees:"),function(_65,_66,_67){
with(_65){
return ((-_67/PI)*180+360)%360;
}
}),new objj_method(sel_getUid("degreesToRadians:"),function(_68,_69,_6a){
with(_68){
return -(((_6a-360)/180)*PI);
}
})]);
p;13;CPColorWell.jt;6079;@STATIC;1.0;I;21;Foundation/CPString.ji;8;CPView.ji;9;CPColor.ji;14;CPColorPanel.jt;5990;
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("CPView.j",YES);
objj_executeFile("CPColor.j",YES);
objj_executeFile("CPColorPanel.j",YES);
var _1="_CPColorWellDidBecomeExclusiveNotification";
var _2=objj_allocateClassPair(CPControl,"CPColorWell"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_active"),new objj_ivar("_bordered"),new objj_ivar("_color"),new objj_ivar("_wellView")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("initWithFrame:"),function(_4,_5,_6){
with(_4){
_4=objj_msgSendSuper({receiver:_4,super_class:objj_getClass("CPColorWell").super_class},"initWithFrame:",_6);
if(_4){
_active=NO;
_bordered=YES;
_color=objj_msgSend(CPColor,"whiteColor");
objj_msgSend(_4,"drawBezelWithHighlight:",NO);
objj_msgSend(_4,"drawWellInside:",CGRectInset(objj_msgSend(_4,"bounds"),3,3));
objj_msgSend(_4,"_registerForNotifications");
}
return _4;
}
}),new objj_method(sel_getUid("_registerForNotifications"),function(_7,_8){
with(_7){
var _9=objj_msgSend(CPNotificationCenter,"defaultCenter");
objj_msgSend(_9,"addObserver:selector:name:object:",_7,sel_getUid("colorWellDidBecomeExclusive:"),_1,nil);
objj_msgSend(_9,"addObserver:selector:name:object:",_7,sel_getUid("colorPanelWillClose:"),CPWindowWillCloseNotification,objj_msgSend(CPColorPanel,"sharedColorPanel"));
}
}),new objj_method(sel_getUid("isBordered"),function(_a,_b){
with(_a){
return _bordered;
}
}),new objj_method(sel_getUid("setBordered:"),function(_c,_d,_e){
with(_c){
if(_bordered==_e){
return;
}
_bordered=_e;
objj_msgSend(_c,"drawWellInside:",CGRectInset(objj_msgSend(_c,"bounds"),3,3));
}
}),new objj_method(sel_getUid("color"),function(_f,_10){
with(_f){
return _color;
}
}),new objj_method(sel_getUid("setColor:"),function(_11,_12,_13){
with(_11){
if(_color==_13){
return;
}
_color=_13;
objj_msgSend(_11,"drawWellInside:",CGRectInset(objj_msgSend(_11,"bounds"),3,3));
}
}),new objj_method(sel_getUid("takeColorFrom:"),function(_14,_15,_16){
with(_14){
objj_msgSend(_14,"setColor:",objj_msgSend(_16,"color"));
}
}),new objj_method(sel_getUid("activate:"),function(_17,_18,_19){
with(_17){
if(_19){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",_1,_17);
}
if(objj_msgSend(_17,"isActive")){
return;
}
_active=YES;
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"addObserver:selector:name:object:",_17,sel_getUid("colorPanelDidChangeColor:"),CPColorPanelColorDidChangeNotification,objj_msgSend(CPColorPanel,"sharedColorPanel"));
}
}),new objj_method(sel_getUid("deactivate"),function(_1a,_1b){
with(_1a){
if(!objj_msgSend(_1a,"isActive")){
return;
}
_active=NO;
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"removeObserver:name:object:",_1a,CPColorPanelColorDidChangeNotification,objj_msgSend(CPColorPanel,"sharedColorPanel"));
}
}),new objj_method(sel_getUid("isActive"),function(_1c,_1d){
with(_1c){
return _active;
}
}),new objj_method(sel_getUid("drawBezelWithHighlight:"),function(_1e,_1f,_20){
with(_1e){
}
}),new objj_method(sel_getUid("drawWellInside:"),function(_21,_22,_23){
with(_21){
if(!_wellView){
_wellView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",_23);
objj_msgSend(_wellView,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
objj_msgSend(_21,"addSubview:",_wellView);
}else{
objj_msgSend(_wellView,"setFrame:",_23);
}
objj_msgSend(_wellView,"setBackgroundColor:",_color);
}
}),new objj_method(sel_getUid("colorPanelDidChangeColor:"),function(_24,_25,_26){
with(_24){
objj_msgSend(_24,"takeColorFrom:",objj_msgSend(_26,"object"));
objj_msgSend(_24,"sendAction:to:",objj_msgSend(_24,"action"),objj_msgSend(_24,"target"));
}
}),new objj_method(sel_getUid("colorWellDidBecomeExclusive:"),function(_27,_28,_29){
with(_27){
if(_27!=objj_msgSend(_29,"object")){
objj_msgSend(_27,"deactivate");
}
}
}),new objj_method(sel_getUid("colorPanelWillClose:"),function(_2a,_2b,_2c){
with(_2a){
objj_msgSend(_2a,"deactivate");
}
}),new objj_method(sel_getUid("mouseDown:"),function(_2d,_2e,_2f){
with(_2d){
objj_msgSend(_2d,"drawBezelWithHighlight:",YES);
}
}),new objj_method(sel_getUid("mouseDragged:"),function(_30,_31,_32){
with(_30){
objj_msgSend(_30,"drawBezelWithHighlight:",CGRectContainsPoint(objj_msgSend(_30,"bounds"),objj_msgSend(_30,"convertPoint:fromView:",objj_msgSend(_32,"locationInWindow"),nil)));
}
}),new objj_method(sel_getUid("mouseUp:"),function(_33,_34,_35){
with(_33){
objj_msgSend(_33,"drawBezelWithHighlight:",NO);
if(!CGRectContainsPoint(objj_msgSend(_33,"bounds"),objj_msgSend(_33,"convertPoint:fromView:",objj_msgSend(_35,"locationInWindow"),nil))){
return;
}
objj_msgSend(_33,"activate:",YES);
var _36=objj_msgSend(CPColorPanel,"sharedColorPanel");
objj_msgSend(_36,"setColor:",_color);
objj_msgSend(_36,"orderFront:",_33);
}
})]);
var _37="CPColorWellColorKey",_38="CPColorWellBorderedKey";
var _2=objj_getClass("CPColorWell");
if(!_2){
throw new SyntaxError("*** Could not find definition for class \"CPColorWell\"");
}
var _3=_2.isa;
class_addMethods(_2,[new objj_method(sel_getUid("initWithCoder:"),function(_39,_3a,_3b){
with(_39){
_39=objj_msgSendSuper({receiver:_39,super_class:objj_getClass("CPColorWell").super_class},"initWithCoder:",_3b);
if(_39){
_active=NO;
_bordered=objj_msgSend(_3b,"decodeObjectForKey:",_38);
_color=objj_msgSend(_3b,"decodeObjectForKey:",_37);
objj_msgSend(_39,"drawBezelWithHighlight:",NO);
objj_msgSend(_39,"drawWellInside:",CGRectInset(objj_msgSend(_39,"bounds"),3,3));
objj_msgSend(_39,"_registerForNotifications");
}
return _39;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_3c,_3d,_3e){
with(_3c){
var _3f=_subviews;
_subviews=objj_msgSend(_subviews,"copy");
objj_msgSend(_subviews,"removeObjectIdenticalTo:",_wellView);
objj_msgSendSuper({receiver:_3c,super_class:objj_getClass("CPColorWell").super_class},"encodeWithCoder:",_3e);
_subviews=_3f;
objj_msgSend(_3e,"encodeObject:forKey:",_color,_37);
objj_msgSend(_3e,"encodeObject:forKey:",_bordered,_38);
}
})]);
p;17;CPCompatibility.jt;3810;@STATIC;1.0;i;9;CPEvent.ji;12;CPPlatform.jt;3761;
objj_executeFile("CPEvent.j",YES);
objj_executeFile("CPPlatform.j",YES);
CPUnknownBrowserEngine=0;
CPGeckoBrowserEngine=1;
CPInternetExplorerBrowserEngine=2;
CPKHTMLBrowserEngine=3;
CPOperaBrowserEngine=4;
CPWebKitBrowserEngine=5;
CPMacOperatingSystem=0;
CPWindowsOperatingSystem=1;
CPOtherOperatingSystem=2;
CPCSSRGBAFeature=1<<5;
CPHTMLCanvasFeature=1<<6;
CPHTMLContentEditableFeature=1<<7;
CPHTMLDragAndDropFeature=1<<8;
CPJavascriptInnerTextFeature=1<<9;
CPJavascriptTextContentFeature=1<<10;
CPJavascriptClipboardEventsFeature=1<<11;
CPJavascriptClipboardAccessFeature=1<<12;
CPJavaScriptCanvasDrawFeature=1<<13;
CPJavaScriptCanvasTransformFeature=1<<14;
CPVMLFeature=1<<15;
CPJavascriptRemedialKeySupport=1<<16;
CPJavaScriptShadowFeature=1<<20;
CPJavaScriptNegativeMouseWheelValues=1<<22;
CPJavaScriptMouseWheelValues_8_15=1<<23;
CPOpacityRequiresFilterFeature=1<<24;
CPInputTypeCanBeChangedFeature=1<<25;
CPHTML5DragAndDropSourceYOffBy1=1<<26;
var _1="",_2=CPUnknownBrowserEngine,_3=0;
_3|=CPInputTypeCanBeChangedFeature;
if(typeof window!="undfined"&&typeof window.navigator!="undefined"){
_1=window.navigator.userAgent;
}
if(window.opera){
_2=CPOperaBrowserEngine;
_3|=CPJavaScriptCanvasDrawFeature;
}else{
if(window.attachEvent){
_2=CPInternetExplorerBrowserEngine;
_3|=CPVMLFeature;
_3|=CPJavascriptRemedialKeySupport;
_3|=CPJavaScriptShadowFeature;
_3|=CPOpacityRequiresFilterFeature;
_3&=~CPInputTypeCanBeChangedFeature;
}else{
if(_1.indexOf("AppleWebKit/")!=-1){
_2=CPWebKitBrowserEngine;
_3|=CPCSSRGBAFeature;
_3|=CPHTMLContentEditableFeature;
if(_1.indexOf("Chrome")===-1){
_3|=CPHTMLDragAndDropFeature;
}
_3|=CPJavascriptClipboardEventsFeature;
_3|=CPJavascriptClipboardAccessFeature;
_3|=CPJavaScriptShadowFeature;
var _4=_1.indexOf("AppleWebKit/")+"AppleWebKit/".length,_5=_1.indexOf(" ",_4),_6=_1.substring(_4,_5),_7=_6.indexOf("."),_8=parseInt(_6.substring(0,_7)),_9=parseInt(_6.substr(_7+1));
if((_1.indexOf("Safari")!==CPNotFound&&(_8>525||(_8===525&&_9>14)))||_1.indexOf("Chrome")!==CPNotFound){
_3|=CPJavascriptRemedialKeySupport;
}
if(!objj_msgSend(CPPlatform,"isBrowser")){
_3|=CPJavascriptRemedialKeySupport;
}
if(_8<532||(_8===532&&_9<6)){
_3|=CPHTML5DragAndDropSourceYOffBy1;
}
}else{
if(_1.indexOf("KHTML")!=-1){
_2=CPKHTMLBrowserEngine;
}else{
if(_1.indexOf("Gecko")!==-1){
_2=CPGeckoBrowserEngine;
_3|=CPJavaScriptCanvasDrawFeature;
var _a=_1.indexOf("Firefox"),_b=(_a===-1)?2:parseFloat(_1.substring(_a+"Firefox".length+1));
if(_b>=3){
_3|=CPCSSRGBAFeature;
}
if(_b<3){
_3|=CPJavaScriptMouseWheelValues_8_15;
}
}
}
}
}
}
if(typeof document!="undefined"){
var _c=document.createElement("canvas");
if(_c&&_c.getContext){
_3|=CPHTMLCanvasFeature;
var _d=document.createElement("canvas").getContext("2d");
if(_d&&_d.setTransform&&_d.transform){
_3|=CPJavaScriptCanvasTransformFeature;
}
}
var _e=document.createElement("div");
if(_e.innerText!=undefined){
_3|=CPJavascriptInnerTextFeature;
}else{
if(_e.textContent!=undefined){
_3|=CPJavascriptTextContentFeature;
}
}
}
CPFeatureIsCompatible=function(_f){
return _3&_f;
};
CPBrowserIsEngine=function(_10){
return _2===_10;
};
CPBrowserIsOperatingSystem=function(_11){
return OPERATING_SYSTEM===_11;
};
OPERATING_SYSTEM=CPOtherOperatingSystem;
if(_1.indexOf("Mac")!==-1){
OPERATING_SYSTEM=CPMacOperatingSystem;
CPPlatformActionKeyMask=CPCommandKeyMask;
CPUndoKeyEquivalent="z";
CPRedoKeyEquivalent="Z";
CPUndoKeyEquivalentModifierMask=CPCommandKeyMask;
CPRedoKeyEquivalentModifierMask=CPCommandKeyMask;
}else{
if(_1.indexOf("Windows")!==-1){
OPERATING_SYSTEM=CPWindowsOperatingSystem;
}
CPPlatformActionKeyMask=CPControlKeyMask;
CPUndoKeyEquivalent="z";
CPRedoKeyEquivalent="y";
CPUndoKeyEquivalentModifierMask=CPControlKeyMask;
CPRedoKeyEquivalentModifierMask=CPControlKeyMask;
}
p;11;CPControl.jt;17610;@STATIC;1.0;i;8;CPFont.ji;10;CPShadow.ji;8;CPView.jt;17551;
objj_executeFile("CPFont.j",YES);
objj_executeFile("CPShadow.j",YES);
objj_executeFile("CPView.j",YES);
CPLeftTextAlignment=0;
CPRightTextAlignment=1;
CPCenterTextAlignment=2;
CPJustifiedTextAlignment=3;
CPNaturalTextAlignment=4;
CPRegularControlSize=0;
CPSmallControlSize=1;
CPMiniControlSize=2;
CPLineBreakByWordWrapping=0;
CPLineBreakByCharWrapping=1;
CPLineBreakByClipping=2;
CPLineBreakByTruncatingHead=3;
CPLineBreakByTruncatingTail=4;
CPLineBreakByTruncatingMiddle=5;
CPTopVerticalTextAlignment=1,CPCenterVerticalTextAlignment=2,CPBottomVerticalTextAlignment=3;
CPScaleProportionally=0;
CPScaleToFit=1;
CPScaleNone=2;
CPNoImage=0;
CPImageOnly=1;
CPImageLeft=2;
CPImageRight=3;
CPImageBelow=4;
CPImageAbove=5;
CPImageOverlaps=6;
CPOnState=1;
CPOffState=0;
CPMixedState=-1;
CPControlNormalBackgroundColor="CPControlNormalBackgroundColor";
CPControlSelectedBackgroundColor="CPControlSelectedBackgroundColor";
CPControlHighlightedBackgroundColor="CPControlHighlightedBackgroundColor";
CPControlDisabledBackgroundColor="CPControlDisabledBackgroundColor";
CPControlTextDidBeginEditingNotification="CPControlTextDidBeginEditingNotification";
CPControlTextDidChangeNotification="CPControlTextDidChangeNotification";
CPControlTextDidEndEditingNotification="CPControlTextDidEndEditingNotification";
var _1=objj_msgSend(CPColor,"blackColor");
var _2=objj_allocateClassPair(CPView,"CPControl"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_value"),new objj_ivar("_target"),new objj_ivar("_action"),new objj_ivar("_sendActionOn"),new objj_ivar("_sendsActionOnEndEditing"),new objj_ivar("_continuousTracking"),new objj_ivar("_trackingWasWithinFrame"),new objj_ivar("_trackingMouseDownFlags"),new objj_ivar("_previousTrackingLocation"),new objj_ivar("_toolTip")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("sendsActionOnEndEditing"),function(_4,_5){
with(_4){
return _sendsActionOnEndEditing;
}
}),new objj_method(sel_getUid("setSendsActionOnEndEditing:"),function(_6,_7,_8){
with(_6){
_sendsActionOnEndEditing=_8;
}
}),new objj_method(sel_getUid("initWithFrame:"),function(_9,_a,_b){
with(_9){
_9=objj_msgSendSuper({receiver:_9,super_class:objj_getClass("CPControl").super_class},"initWithFrame:",_b);
if(_9){
_sendActionOn=CPLeftMouseUpMask;
_trackingMouseDownFlags=0;
}
return _9;
}
}),new objj_method(sel_getUid("setAction:"),function(_c,_d,_e){
with(_c){
_action=_e;
}
}),new objj_method(sel_getUid("action"),function(_f,_10){
with(_f){
return _action;
}
}),new objj_method(sel_getUid("setTarget:"),function(_11,_12,_13){
with(_11){
_target=_13;
}
}),new objj_method(sel_getUid("target"),function(_14,_15){
with(_14){
return _target;
}
}),new objj_method(sel_getUid("sendAction:to:"),function(_16,_17,_18,_19){
with(_16){
objj_msgSend(CPApp,"sendAction:to:from:",_18,_19,_16);
}
}),new objj_method(sel_getUid("sendActionOn:"),function(_1a,_1b,_1c){
with(_1a){
var _1d=_sendActionOn;
_sendActionOn=_1c;
return _1d;
}
}),new objj_method(sel_getUid("isContinuous"),function(_1e,_1f){
with(_1e){
return (_sendActionOn&CPPeriodicMask)!==0;
}
}),new objj_method(sel_getUid("setContinuous:"),function(_20,_21,_22){
with(_20){
if(_22){
_sendActionOn|=CPPeriodicMask;
}else{
_sendActionOn&=~CPPeriodicMask;
}
}
}),new objj_method(sel_getUid("tracksMouseOutsideOfFrame"),function(_23,_24){
with(_23){
return NO;
}
}),new objj_method(sel_getUid("trackMouse:"),function(_25,_26,_27){
with(_25){
var _28=objj_msgSend(_27,"type"),_29=objj_msgSend(_25,"convertPoint:fromView:",objj_msgSend(_27,"locationInWindow"),nil);
isWithinFrame=objj_msgSend(_25,"tracksMouseOutsideOfFrame")||CGRectContainsPoint(objj_msgSend(_25,"bounds"),_29);
if(_28===CPLeftMouseUp){
objj_msgSend(_25,"stopTracking:at:mouseIsUp:",_previousTrackingLocation,_29,YES);
_trackingMouseDownFlags=0;
}else{
if(_28===CPLeftMouseDown){
_trackingMouseDownFlags=objj_msgSend(_27,"modifierFlags");
_continuousTracking=objj_msgSend(_25,"startTrackingAt:",_29);
}else{
if(_28===CPLeftMouseDragged){
if(isWithinFrame){
if(!_trackingWasWithinFrame){
_continuousTracking=objj_msgSend(_25,"startTrackingAt:",_29);
}else{
if(_continuousTracking){
_continuousTracking=objj_msgSend(_25,"continueTracking:at:",_previousTrackingLocation,_29);
}
}
}else{
objj_msgSend(_25,"stopTracking:at:mouseIsUp:",_previousTrackingLocation,_29,NO);
}
}
}
objj_msgSend(CPApp,"setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:",_25,sel_getUid("trackMouse:"),CPLeftMouseDraggedMask|CPLeftMouseUpMask,nil,nil,YES);
}
if((_sendActionOn&(1<<_28))&&isWithinFrame){
objj_msgSend(_25,"sendAction:to:",_action,_target);
}
_trackingWasWithinFrame=isWithinFrame;
_previousTrackingLocation=_29;
}
}),new objj_method(sel_getUid("setState:"),function(_2a,_2b,_2c){
with(_2a){
}
}),new objj_method(sel_getUid("nextState"),function(_2d,_2e){
with(_2d){
return 0;
}
}),new objj_method(sel_getUid("performClick:"),function(_2f,_30,_31){
with(_2f){
objj_msgSend(_2f,"highlight:",YES);
objj_msgSend(_2f,"setState:",objj_msgSend(_2f,"nextState"));
objj_msgSend(_2f,"sendAction:to:",objj_msgSend(_2f,"action"),objj_msgSend(_2f,"target"));
objj_msgSend(CPTimer,"scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:",0.1,_2f,sel_getUid("unhighlightButtonTimerDidFinish:"),nil,NO);
}
}),new objj_method(sel_getUid("unhighlightButtonTimerDidFinish:"),function(_32,_33,_34){
with(_32){
objj_msgSend(_32,"highlight:",NO);
}
}),new objj_method(sel_getUid("mouseDownFlags"),function(_35,_36){
with(_35){
return _trackingMouseDownFlags;
}
}),new objj_method(sel_getUid("startTrackingAt:"),function(_37,_38,_39){
with(_37){
objj_msgSend(_37,"highlight:",YES);
return (_sendActionOn&CPPeriodicMask)||(_sendActionOn&CPLeftMouseDraggedMask);
}
}),new objj_method(sel_getUid("continueTracking:at:"),function(_3a,_3b,_3c,_3d){
with(_3a){
return (_sendActionOn&CPPeriodicMask)||(_sendActionOn&CPLeftMouseDraggedMask);
}
}),new objj_method(sel_getUid("stopTracking:at:mouseIsUp:"),function(_3e,_3f,_40,_41,_42){
with(_3e){
objj_msgSend(_3e,"highlight:",NO);
}
}),new objj_method(sel_getUid("mouseDown:"),function(_43,_44,_45){
with(_43){
if(!objj_msgSend(_43,"isEnabled")){
return;
}
objj_msgSend(_43,"trackMouse:",_45);
}
}),new objj_method(sel_getUid("objectValue"),function(_46,_47){
with(_46){
return _value;
}
}),new objj_method(sel_getUid("setObjectValue:"),function(_48,_49,_4a){
with(_48){
_value=_4a;
objj_msgSend(_48,"setNeedsLayout");
objj_msgSend(_48,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("floatValue"),function(_4b,_4c){
with(_4b){
var _4d=parseFloat(_value,10);
return isNaN(_4d)?0:_4d;
}
}),new objj_method(sel_getUid("setFloatValue:"),function(_4e,_4f,_50){
with(_4e){
objj_msgSend(_4e,"setObjectValue:",_50);
}
}),new objj_method(sel_getUid("doubleValue"),function(_51,_52){
with(_51){
var _53=parseFloat(_value,10);
return isNaN(_53)?0:_53;
}
}),new objj_method(sel_getUid("setDoubleValue:"),function(_54,_55,_56){
with(_54){
objj_msgSend(_54,"setObjectValue:",_56);
}
}),new objj_method(sel_getUid("intValue"),function(_57,_58){
with(_57){
var _59=parseInt(_value,10);
return isNaN(_59)?0:_59;
}
}),new objj_method(sel_getUid("setIntValue:"),function(_5a,_5b,_5c){
with(_5a){
objj_msgSend(_5a,"setObjectValue:",_5c);
}
}),new objj_method(sel_getUid("integerValue"),function(_5d,_5e){
with(_5d){
var _5f=parseInt(_value,10);
return isNaN(_5f)?0:_5f;
}
}),new objj_method(sel_getUid("setIntegerValue:"),function(_60,_61,_62){
with(_60){
objj_msgSend(_60,"setObjectValue:",_62);
}
}),new objj_method(sel_getUid("stringValue"),function(_63,_64){
with(_63){
return (_value===undefined||_value===nil)?"":String(_value);
}
}),new objj_method(sel_getUid("setStringValue:"),function(_65,_66,_67){
with(_65){
objj_msgSend(_65,"setObjectValue:",_67);
}
}),new objj_method(sel_getUid("takeDoubleValueFrom:"),function(_68,_69,_6a){
with(_68){
if(objj_msgSend(_6a,"respondsToSelector:",sel_getUid("doubleValue"))){
objj_msgSend(_68,"setDoubleValue:",objj_msgSend(_6a,"doubleValue"));
}
}
}),new objj_method(sel_getUid("takeFloatValueFrom:"),function(_6b,_6c,_6d){
with(_6b){
if(objj_msgSend(_6d,"respondsToSelector:",sel_getUid("floatValue"))){
objj_msgSend(_6b,"setFloatValue:",objj_msgSend(_6d,"floatValue"));
}
}
}),new objj_method(sel_getUid("takeIntegerValueFrom:"),function(_6e,_6f,_70){
with(_6e){
if(objj_msgSend(_70,"respondsToSelector:",sel_getUid("integerValue"))){
objj_msgSend(_6e,"setIntegerValue:",objj_msgSend(_70,"integerValue"));
}
}
}),new objj_method(sel_getUid("takeIntValueFrom:"),function(_71,_72,_73){
with(_71){
if(objj_msgSend(_73,"respondsToSelector:",sel_getUid("intValue"))){
objj_msgSend(_71,"setIntValue:",objj_msgSend(_73,"intValue"));
}
}
}),new objj_method(sel_getUid("takeObjectValueFrom:"),function(_74,_75,_76){
with(_74){
if(objj_msgSend(_76,"respondsToSelector:",sel_getUid("objectValue"))){
objj_msgSend(_74,"setObjectValue:",objj_msgSend(_76,"objectValue"));
}
}
}),new objj_method(sel_getUid("takeStringValueFrom:"),function(_77,_78,_79){
with(_77){
if(objj_msgSend(_79,"respondsToSelector:",sel_getUid("stringValue"))){
objj_msgSend(_77,"setStringValue:",objj_msgSend(_79,"stringValue"));
}
}
}),new objj_method(sel_getUid("textDidBeginEditing:"),function(_7a,_7b,_7c){
with(_7a){
if(objj_msgSend(_7c,"object")!=_7a){
return;
}
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:userInfo:",CPControlTextDidBeginEditingNotification,_7a,objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",objj_msgSend(_7c,"object"),"CPFieldEditor"));
}
}),new objj_method(sel_getUid("textDidChange:"),function(_7d,_7e,_7f){
with(_7d){
if(objj_msgSend(_7f,"object")!=_7d){
return;
}
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:userInfo:",CPControlTextDidChangeNotification,_7d,objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",objj_msgSend(_7f,"object"),"CPFieldEditor"));
}
}),new objj_method(sel_getUid("textDidEndEditing:"),function(_80,_81,_82){
with(_80){
if(objj_msgSend(_82,"object")!=_80){
return;
}
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:userInfo:",CPControlTextDidEndEditingNotification,_80,objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",objj_msgSend(_82,"object"),"CPFieldEditor"));
}
}),new objj_method(sel_getUid("setAlignment:"),function(_83,_84,_85){
with(_83){
objj_msgSend(_83,"setValue:forThemeAttribute:",_85,"alignment");
}
}),new objj_method(sel_getUid("alignment"),function(_86,_87){
with(_86){
return objj_msgSend(_86,"valueForThemeAttribute:","alignment");
}
}),new objj_method(sel_getUid("setVerticalAlignment:"),function(_88,_89,_8a){
with(_88){
objj_msgSend(_88,"setValue:forThemeAttribute:",_8a,"vertical-alignment");
}
}),new objj_method(sel_getUid("verticalAlignment"),function(_8b,_8c){
with(_8b){
return objj_msgSend(_8b,"valueForThemeAttribute:","vertical-alignment");
}
}),new objj_method(sel_getUid("setLineBreakMode:"),function(_8d,_8e,_8f){
with(_8d){
objj_msgSend(_8d,"setValue:forThemeAttribute:",_8f,"line-break-mode");
}
}),new objj_method(sel_getUid("lineBreakMode"),function(_90,_91){
with(_90){
return objj_msgSend(_90,"valueForThemeAttribute:","line-break-mode");
}
}),new objj_method(sel_getUid("setTextColor:"),function(_92,_93,_94){
with(_92){
objj_msgSend(_92,"setValue:forThemeAttribute:",_94,"text-color");
}
}),new objj_method(sel_getUid("textColor"),function(_95,_96){
with(_95){
return objj_msgSend(_95,"valueForThemeAttribute:","text-color");
}
}),new objj_method(sel_getUid("setFont:"),function(_97,_98,_99){
with(_97){
objj_msgSend(_97,"setValue:forThemeAttribute:",_99,"font");
}
}),new objj_method(sel_getUid("font"),function(_9a,_9b){
with(_9a){
return objj_msgSend(_9a,"valueForThemeAttribute:","font");
}
}),new objj_method(sel_getUid("setTextShadowColor:"),function(_9c,_9d,_9e){
with(_9c){
objj_msgSend(_9c,"setValue:forThemeAttribute:",_9e,"text-shadow-color");
}
}),new objj_method(sel_getUid("textShadowColor"),function(_9f,_a0){
with(_9f){
return objj_msgSend(_9f,"valueForThemeAttribute:","text-shadow-color");
}
}),new objj_method(sel_getUid("setTextShadowOffset:"),function(_a1,_a2,_a3){
with(_a1){
objj_msgSend(_a1,"setValue:forThemeAttribute:",_a3,"text-shadow-offset");
}
}),new objj_method(sel_getUid("textShadowOffset"),function(_a4,_a5){
with(_a4){
return objj_msgSend(_a4,"valueForThemeAttribute:","text-shadow-offset");
}
}),new objj_method(sel_getUid("setImagePosition:"),function(_a6,_a7,_a8){
with(_a6){
objj_msgSend(_a6,"setValue:forThemeAttribute:",_a8,"image-position");
}
}),new objj_method(sel_getUid("imagePosition"),function(_a9,_aa){
with(_a9){
return objj_msgSend(_a9,"valueForThemeAttribute:","image-position");
}
}),new objj_method(sel_getUid("setImageScaling:"),function(_ab,_ac,_ad){
with(_ab){
objj_msgSend(_ab,"setValue:forThemeAttribute:",_ad,"image-scaling");
}
}),new objj_method(sel_getUid("imageScaling"),function(_ae,_af){
with(_ae){
return objj_msgSend(_ae,"valueForThemeAttribute:","image-scaling");
}
}),new objj_method(sel_getUid("setEnabled:"),function(_b0,_b1,_b2){
with(_b0){
if(_b2){
objj_msgSend(_b0,"unsetThemeState:",CPThemeStateDisabled);
}else{
objj_msgSend(_b0,"setThemeState:",CPThemeStateDisabled);
}
}
}),new objj_method(sel_getUid("isEnabled"),function(_b3,_b4){
with(_b3){
return !objj_msgSend(_b3,"hasThemeState:",CPThemeStateDisabled);
}
}),new objj_method(sel_getUid("highlight:"),function(_b5,_b6,_b7){
with(_b5){
objj_msgSend(_b5,"setHighlighted:",_b7);
}
}),new objj_method(sel_getUid("setHighlighted:"),function(_b8,_b9,_ba){
with(_b8){
if(_ba){
objj_msgSend(_b8,"setThemeState:",CPThemeStateHighlighted);
}else{
objj_msgSend(_b8,"unsetThemeState:",CPThemeStateHighlighted);
}
}
}),new objj_method(sel_getUid("isHighlighted"),function(_bb,_bc){
with(_bb){
return objj_msgSend(_bb,"hasThemeState:",CPThemeStateHighlighted);
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("themeAttributes"),function(_bd,_be){
with(_bd){
return objj_msgSend(CPDictionary,"dictionaryWithObjects:forKeys:",[CPLeftTextAlignment,CPTopVerticalTextAlignment,CPLineBreakByClipping,objj_msgSend(CPColor,"blackColor"),objj_msgSend(CPFont,"systemFontOfSize:",12),objj_msgSend(CPNull,"null"),{width:0,height:0},CPImageLeft,CPScaleToFit,{width:0,height:0},{width:-1,height:-1}],["alignment","vertical-alignment","line-break-mode","text-color","font","text-shadow-color","text-shadow-offset","image-position","image-scaling","min-size","max-size"]);
}
})]);
var _bf="CPControlValueKey",_c0="CPControlControlStateKey",_c1="CPControlIsEnabledKey",_c2="CPControlTargetKey",_c3="CPControlActionKey",_c4="CPControlSendActionOnKey",_c5="CPControlSendsActionOnEndEditingKey";
var _c6="CPImageViewImageKey";
var _2=objj_getClass("CPControl");
if(!_2){
throw new SyntaxError("*** Could not find definition for class \"CPControl\"");
}
var _3=_2.isa;
class_addMethods(_2,[new objj_method(sel_getUid("initWithCoder:"),function(_c7,_c8,_c9){
with(_c7){
_c7=objj_msgSendSuper({receiver:_c7,super_class:objj_getClass("CPControl").super_class},"initWithCoder:",_c9);
if(_c7){
objj_msgSend(_c7,"setObjectValue:",objj_msgSend(_c9,"decodeObjectForKey:",_bf));
objj_msgSend(_c7,"setTarget:",objj_msgSend(_c9,"decodeObjectForKey:",_c2));
objj_msgSend(_c7,"setAction:",objj_msgSend(_c9,"decodeObjectForKey:",_c3));
objj_msgSend(_c7,"sendActionOn:",objj_msgSend(_c9,"decodeIntForKey:",_c4));
objj_msgSend(_c7,"setSendsActionOnEndEditing:",objj_msgSend(_c9,"decodeBoolForKey:",_c5));
}
return _c7;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_ca,_cb,_cc){
with(_ca){
objj_msgSendSuper({receiver:_ca,super_class:objj_getClass("CPControl").super_class},"encodeWithCoder:",_cc);
if(_sendsActionOnEndEditing){
objj_msgSend(_cc,"encodeBool:forKey:",_sendsActionOnEndEditing,_c5);
}
if(_value!==nil){
objj_msgSend(_cc,"encodeObject:forKey:",_value,_bf);
}
if(_target!==nil){
objj_msgSend(_cc,"encodeConditionalObject:forKey:",_target,_c2);
}
if(_action!==NULL){
objj_msgSend(_cc,"encodeObject:forKey:",_action,_c3);
}
objj_msgSend(_cc,"encodeInt:forKey:",_sendActionOn,_c4);
}
})]);
var _cd=[],_ce={},_cf={};
_cd[CPRegularControlSize]="Regular";
_cd[CPSmallControlSize]="Small";
_cd[CPMiniControlSize]="Mini";
_CPControlIdentifierForControlSize=function(_d0){
return _cd[_d0];
};
_CPControlColorWithPatternImage=function(_d1,_d2){
var _d3=1,_d4=arguments.length,_d5="";
for(;_d3<_d4;++_d3){
_d5+=arguments[_d3];
}
var _d6=_ce[_d5];
if(!_d6){
var _d7=objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(CPControl,"class"));
_d6=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_d7,"pathForResource:",_d2+"/"+_d5+".png"),_d1[_d5]));
_ce[_d5]=_d6;
}
return _d6;
};
_CPControlThreePartImagePattern=function(_d8,_d9,_da){
var _db=2,_dc=arguments.length,_dd="";
for(;_db<_dc;++_db){
_dd+=arguments[_db];
}
var _de=_cf[_dd];
if(!_de){
var _df=objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(CPControl,"class")),_e0=_da+"/"+_dd;
_d9=_d9[_dd];
_de=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPThreePartImage,"alloc"),"initWithImageSlices:isVertical:",[objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_df,"pathForResource:",_e0+"0.png"),_d9[0]),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_df,"pathForResource:",_e0+"1.png"),_d9[1]),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_df,"pathForResource:",_e0+"2.png"),_d9[2])],_d8));
_cf[_dd]=_de;
}
return _de;
};
p;10;CPCookie.jt;1483;@STATIC;1.0;I;21;Foundation/CPObject.jI;21;Foundation/CPString.jt;1412;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("Foundation/CPString.j",NO);
var _1=objj_allocateClassPair(CPObject,"CPCookie"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_cookieName"),new objj_ivar("_cookieValue"),new objj_ivar("_expires")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithName:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPCookie").super_class},"init");
_cookieName=_5;
_cookieValue=objj_msgSend(_3,"_readCookieValue");
return _3;
}
}),new objj_method(sel_getUid("value"),function(_6,_7){
with(_6){
return _cookieValue;
}
}),new objj_method(sel_getUid("name"),function(_8,_9){
with(_8){
return _cookieName;
}
}),new objj_method(sel_getUid("expires"),function(_a,_b){
with(_a){
return _expires;
}
}),new objj_method(sel_getUid("setValue:expires:domain:"),function(_c,_d,_e,_f,_10){
with(_c){
if(_f){
var _11="; expires="+_f.toGMTString();
}else{
var _11="";
}
if(_10){
_10="; domain="+_10;
}else{
_10="";
}
document.cookie=_cookieName+"="+_e+_11+"; path=/"+_10;
}
}),new objj_method(sel_getUid("_readCookieValue"),function(_12,_13){
with(_12){
var _14=_cookieName+"=";
var ca=document.cookie.split(";");
for(var i=0;i<ca.length;i++){
var c=ca[i];
while(c.charAt(0)==" "){
c=c.substring(1,c.length);
}
if(c.indexOf(_14)==0){
return c.substring(_14.length,c.length);
}
}
return "";
}
})]);
p;10;CPCursor.jt;7648;@STATIC;1.0;t;7629;
var _1=nil,_2=[],_3={},_4=nil;
var _5=objj_allocateClassPair(CPObject,"CPCursor"),_6=_5.isa;
class_addIvars(_5,[new objj_ivar("_cssString"),new objj_ivar("_isSetOnMouseEntered"),new objj_ivar("_isSetOnMouseExited")]);
objj_registerClassPair(_5);
class_addMethods(_5,[new objj_method(sel_getUid("isSetOnMouseEntered"),function(_7,_8){
with(_7){
return _isSetOnMouseEntered;
}
}),new objj_method(sel_getUid("setOnMouseEntered:"),function(_9,_a,_b){
with(_9){
_isSetOnMouseEntered=_b;
}
}),new objj_method(sel_getUid("isSetOnMouseExited"),function(_c,_d){
with(_c){
return _isSetOnMouseExited;
}
}),new objj_method(sel_getUid("setOnMouseExited:"),function(_e,_f,_10){
with(_e){
_isSetOnMouseExited=_10;
}
}),new objj_method(sel_getUid("initWithCSSString:"),function(_11,_12,_13){
with(_11){
if(_11=objj_msgSendSuper({receiver:_11,super_class:objj_getClass("CPCursor").super_class},"init")){
_cssString=_13;
}
return _11;
}
}),new objj_method(sel_getUid("_cssString"),function(_14,_15){
with(_14){
return _cssString;
}
}),new objj_method(sel_getUid("initWithImage:hotSpot:"),function(_16,_17,_18,_19){
with(_16){
return objj_msgSend(_16,"initWithCSSString:","url("+objj_msgSend(_18,"filename")+")");
}
}),new objj_method(sel_getUid("mouseEntered:"),function(_1a,_1b,_1c){
with(_1a){
}
}),new objj_method(sel_getUid("mouseExited:"),function(_1d,_1e,_1f){
with(_1d){
}
}),new objj_method(sel_getUid("set"),function(_20,_21){
with(_20){
_1=_20;
objj_msgSend(objj_msgSend(_20,"class"),"_setCursorCSS:",_cssString);
}
}),new objj_method(sel_getUid("push"),function(_22,_23){
with(_22){
_1=_2.push(_22);
}
}),new objj_method(sel_getUid("pop"),function(_24,_25){
with(_24){
objj_msgSend(CPCursor,"pop");
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_26,_27,_28){
with(_26){
if(_26=objj_msgSendSuper({receiver:_26,super_class:objj_getClass("CPCursor").super_class},"init")){
_cssString=objj_msgSend(_28,"decodeObjectForKey:","CPCursorNameKey");
}
return _26;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_29,_2a,_2b){
with(_29){
objj_msgSend(_2b,"encodeObject:forKey:",_cssString,"CPCursorNameKey");
}
})]);
class_addMethods(_6,[new objj_method(sel_getUid("currentCursor"),function(_2c,_2d){
with(_2c){
return _1;
}
}),new objj_method(sel_getUid("cursorWithCSSString:"),function(_2e,_2f,_30){
with(_2e){
var _31=_3[_30];
if(typeof _31=="undefined"){
_31=objj_msgSend(objj_msgSend(CPCursor,"alloc"),"initWithCSSString:",_30);
_3[_30]=_31;
}
return _31;
}
}),new objj_method(sel_getUid("cursorWithImageNamed:"),function(_32,_33,_34){
with(_32){
if(!_4){
_4="url("+objj_msgSend(objj_msgSend(CPBundle,"bundleForClass:",_32),"resourcePath")+"/CPCursor/%@.cur)";
if(CPBrowserIsEngine(CPGeckoBrowserEngine)){
_4+=", default";
}
}
var url=objj_msgSend(CPString,"stringWithFormat:",_4,_34);
return objj_msgSend(objj_msgSend(CPCursor,"alloc"),"initWithCSSString:",url);
}
}),new objj_method(sel_getUid("arrowCursor"),function(_35,_36){
with(_35){
return objj_msgSend(CPCursor,"cursorWithCSSString:","default");
}
}),new objj_method(sel_getUid("crosshairCursor"),function(_37,_38){
with(_37){
return objj_msgSend(CPCursor,"cursorWithCSSString:","crosshair");
}
}),new objj_method(sel_getUid("IBeamCursor"),function(_39,_3a){
with(_39){
return objj_msgSend(CPCursor,"cursorWithCSSString:","text");
}
}),new objj_method(sel_getUid("pointingHandCursor"),function(_3b,_3c){
with(_3b){
return objj_msgSend(CPCursor,"cursorWithCSSString:","pointer");
}
}),new objj_method(sel_getUid("resizeDownCursor"),function(_3d,_3e){
with(_3d){
if(CPBrowserIsEngine(CPInternetExplorerBrowserEngine)){
return objj_msgSend(CPCursor,"cursorWithImageNamed:",CPStringFromSelector(_3e));
}
return objj_msgSend(CPCursor,"cursorWithCSSString:","s-resize");
}
}),new objj_method(sel_getUid("resizeUpCursor"),function(_3f,_40){
with(_3f){
if(CPBrowserIsEngine(CPInternetExplorerBrowserEngine)){
return objj_msgSend(CPCursor,"cursorWithImageNamed:",CPStringFromSelector(_40));
}
return objj_msgSend(CPCursor,"cursorWithCSSString:","n-resize");
}
}),new objj_method(sel_getUid("resizeLeftCursor"),function(_41,_42){
with(_41){
if(CPBrowserIsEngine(CPInternetExplorerBrowserEngine)){
return objj_msgSend(CPCursor,"cursorWithImageNamed:",CPStringFromSelector(_42));
}
return objj_msgSend(CPCursor,"cursorWithCSSString:","w-resize");
}
}),new objj_method(sel_getUid("resizeRightCursor"),function(_43,_44){
with(_43){
if(CPBrowserIsEngine(CPInternetExplorerBrowserEngine)){
return objj_msgSend(CPCursor,"cursorWithImageNamed:",CPStringFromSelector(_44));
}
return objj_msgSend(CPCursor,"cursorWithCSSString:","e-resize");
}
}),new objj_method(sel_getUid("resizeLeftRightCursor"),function(_45,_46){
with(_45){
return objj_msgSend(CPCursor,"cursorWithCSSString:","col-resize");
}
}),new objj_method(sel_getUid("resizeUpDownCursor"),function(_47,_48){
with(_47){
return objj_msgSend(CPCursor,"cursorWithCSSString:","row-resize");
}
}),new objj_method(sel_getUid("operationNotAllowedCursor"),function(_49,_4a){
with(_49){
return objj_msgSend(CPCursor,"cursorWithCSSString:","not-allowed");
}
}),new objj_method(sel_getUid("dragCopyCursor"),function(_4b,_4c){
with(_4b){
if(CPBrowserIsEngine(CPInternetExplorerBrowserEngine)){
return objj_msgSend(CPCursor,"cursorWithImageNamed:",CPStringFromSelector(_4c));
}
return objj_msgSend(CPCursor,"cursorWithCSSString:","copy");
}
}),new objj_method(sel_getUid("dragLinkCursor"),function(_4d,_4e){
with(_4d){
if(CPBrowserIsEngine(CPInternetExplorerBrowserEngine)){
return objj_msgSend(CPCursor,"cursorWithImageNamed:",CPStringFromSelector(_4e));
}
return objj_msgSend(CPCursor,"cursorWithCSSString:","alias");
}
}),new objj_method(sel_getUid("contextualMenuCursor"),function(_4f,_50){
with(_4f){
if(CPBrowserIsEngine(CPInternetExplorerBrowserEngine)){
return objj_msgSend(CPCursor,"cursorWithImageNamed:",CPStringFromSelector(_50));
}
return objj_msgSend(CPCursor,"cursorWithCSSString:","context-menu");
}
}),new objj_method(sel_getUid("openHandCursor"),function(_51,_52){
with(_51){
if(CPBrowserIsEngine(CPWebKitBrowserEngine)){
return objj_msgSend(CPCursor,"cursorWithCSSString:","-webkit-grab");
}else{
if(CPBrowserIsEngine(CPGeckoBrowserEngine)||CPBrowserIsEngine(CPOperaBrowserEngine)){
return objj_msgSend(CPCursor,"cursorWithCSSString:","move");
}
}
return objj_msgSend(CPCursor,"cursorWithImageNamed:",CPStringFromSelector(_52));
}
}),new objj_method(sel_getUid("closedHandCursor"),function(_53,_54){
with(_53){
if(CPBrowserIsEngine(CPWebKitBrowserEngine)){
return objj_msgSend(CPCursor,"cursorWithCSSString:","-webkit-grabbing");
}
return objj_msgSend(CPCursor,"cursorWithImageNamed:",CPStringFromSelector(_54));
}
}),new objj_method(sel_getUid("disappearingItemCursor"),function(_55,_56){
with(_55){
return objj_msgSend(CPCursor,"cursorWithImageNamed:",CPStringFromSelector(_56));
}
}),new objj_method(sel_getUid("hide"),function(_57,_58){
with(_57){
objj_msgSend(_57,"_setCursorCSS:","none");
}
}),new objj_method(sel_getUid("unhide"),function(_59,_5a){
with(_59){
objj_msgSend(_59,"_setCursorCSS:",objj_msgSend(_1,"_cssString"));
}
}),new objj_method(sel_getUid("setHiddenUntilMouseMoves:"),function(_5b,_5c,_5d){
with(_5b){
if(_5d){
objj_msgSend(CPCursor,"hide");
}else{
objj_msgSend(CPCursor,"unhide");
}
}
}),new objj_method(sel_getUid("_setCursorCSS:"),function(_5e,_5f,_60){
with(_5e){
var _61=objj_msgSend(objj_msgSend(CPPlatformWindow,"visiblePlatformWindows"),"allObjects");
for(var i=0,_62=objj_msgSend(_61,"count");i<_62;i++){
_61[i]._DOMBodyElement.style.cursor=_60;
}
}
}),new objj_method(sel_getUid("pop"),function(_63,_64){
with(_63){
if(_2.length>1){
_2.pop();
_1=_2[_2.length-1];
}
}
})]);
p;12;CPDocument.jt;18916;@STATIC;1.0;I;21;Foundation/CPString.jI;20;Foundation/CPArray.ji;13;CPResponder.ji;13;CPSavePanel.ji;18;CPViewController.ji;20;CPWindowController.jt;18761;
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("Foundation/CPArray.j",NO);
objj_executeFile("CPResponder.j",YES);
objj_executeFile("CPSavePanel.j",YES);
objj_executeFile("CPViewController.j",YES);
objj_executeFile("CPWindowController.j",YES);
CPSaveOperation=0;
CPSaveAsOperation=1;
CPSaveToOperation=2;
CPAutosaveOperation=3;
CPChangeDone=0;
CPChangeUndone=1;
CPChangeCleared=2;
CPChangeReadOtherContents=3;
CPChangeAutosaved=4;
CPDocumentWillSaveNotification="CPDocumentWillSaveNotification";
CPDocumentDidSaveNotification="CPDocumentDidSaveNotification";
CPDocumentDidFailToSaveNotification="CPDocumentDidFailToSaveNotification";
var _1=0;
var _2=objj_allocateClassPair(CPResponder,"CPDocument"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_window"),new objj_ivar("_view"),new objj_ivar("_viewControllersForWindowControllers"),new objj_ivar("_fileURL"),new objj_ivar("_fileType"),new objj_ivar("_windowControllers"),new objj_ivar("_untitledDocumentIndex"),new objj_ivar("_hasUndoManager"),new objj_ivar("_undoManager"),new objj_ivar("_changeCount"),new objj_ivar("_readConnection"),new objj_ivar("_writeRequest"),new objj_ivar("_canCloseAlert")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("init"),function(_4,_5){
with(_4){
_4=objj_msgSendSuper({receiver:_4,super_class:objj_getClass("CPDocument").super_class},"init");
if(_4){
_windowControllers=[];
_viewControllersForWindowControllers=objj_msgSend(CPDictionary,"dictionary");
_hasUndoManager=YES;
_changeCount=0;
objj_msgSend(_4,"setNextResponder:",CPApp);
}
return _4;
}
}),new objj_method(sel_getUid("initWithType:error:"),function(_6,_7,_8,_9){
with(_6){
_6=objj_msgSend(_6,"init");
if(_6){
objj_msgSend(_6,"setFileType:",_8);
}
return _6;
}
}),new objj_method(sel_getUid("initWithContentsOfURL:ofType:delegate:didReadSelector:contextInfo:"),function(_a,_b,_c,_d,_e,_f,_10){
with(_a){
_a=objj_msgSend(_a,"init");
if(_a){
objj_msgSend(_a,"setFileURL:",_c);
objj_msgSend(_a,"setFileType:",_d);
objj_msgSend(_a,"readFromURL:ofType:delegate:didReadSelector:contextInfo:",_c,_d,_e,_f,_10);
}
return _a;
}
}),new objj_method(sel_getUid("initForURL:withContentsOfURL:ofType:delegate:didReadSelector:contextInfo:"),function(_11,_12,_13,_14,_15,_16,_17,_18){
with(_11){
_11=objj_msgSend(_11,"init");
if(_11){
objj_msgSend(_11,"setFileURL:",_13);
objj_msgSend(_11,"setFileType:",_15);
objj_msgSend(_11,"readFromURL:ofType:delegate:didReadSelector:contextInfo:",_14,_15,_16,_17,_18);
}
return _11;
}
}),new objj_method(sel_getUid("dataOfType:error:"),function(_19,_1a,_1b,_1c){
with(_19){
objj_msgSend(CPException,"raise:reason:",CPUnsupportedMethodException,"dataOfType:error: must be overridden by the document subclass.");
}
}),new objj_method(sel_getUid("readFromData:ofType:error:"),function(_1d,_1e,_1f,_20,_21){
with(_1d){
objj_msgSend(CPException,"raise:reason:",CPUnsupportedMethodException,"readFromData:ofType: must be overridden by the document subclass.");
}
}),new objj_method(sel_getUid("viewControllerWillLoadCib:"),function(_22,_23,_24){
with(_22){
}
}),new objj_method(sel_getUid("viewControllerDidLoadCib:"),function(_25,_26,_27){
with(_25){
}
}),new objj_method(sel_getUid("firstEligibleExistingWindowController"),function(_28,_29){
with(_28){
return nil;
}
}),new objj_method(sel_getUid("makeWindowControllers"),function(_2a,_2b){
with(_2a){
objj_msgSend(_2a,"makeViewAndWindowControllers");
}
}),new objj_method(sel_getUid("makeViewAndWindowControllers"),function(_2c,_2d){
with(_2c){
var _2e=objj_msgSend(_2c,"viewCibName"),_2f=nil,_30=nil;
if(objj_msgSend(_2e,"length")){
_2f=objj_msgSend(objj_msgSend(CPViewController,"alloc"),"initWithCibName:bundle:owner:",_2e,nil,_2c);
}
if(_2f){
_30=objj_msgSend(_2c,"firstEligibleExistingWindowController");
}
if(!_30){
var _31=objj_msgSend(_2c,"windowCibName");
if(objj_msgSend(_31,"length")){
_30=objj_msgSend(objj_msgSend(CPWindowController,"alloc"),"initWithWindowCibName:owner:",_31,_2c);
}else{
if(_2f){
var _32=objj_msgSend(_2f,"view"),_33=objj_msgSend(_32,"frame");
_33.origin=CGPointMake(50,50);
var _34=objj_msgSend(objj_msgSend(CPWindow,"alloc"),"initWithContentRect:styleMask:",_33,CPTitledWindowMask|CPClosableWindowMask|CPMiniaturizableWindowMask|CPResizableWindowMask);
_30=objj_msgSend(objj_msgSend(CPWindowController,"alloc"),"initWithWindow:",_34);
}
}
}
if(_30&&_2f){
objj_msgSend(_30,"setSupportsMultipleDocuments:",YES);
}
if(_30){
objj_msgSend(_2c,"addWindowController:",_30);
}
if(_2f){
objj_msgSend(_2c,"addViewController:forWindowController:",_2f,_30);
}
}
}),new objj_method(sel_getUid("windowControllers"),function(_35,_36){
with(_35){
return _windowControllers;
}
}),new objj_method(sel_getUid("addWindowController:"),function(_37,_38,_39){
with(_37){
objj_msgSend(_windowControllers,"addObject:",_39);
if(objj_msgSend(_39,"document")!==_37){
objj_msgSend(_39,"setDocument:",_37);
}
}
}),new objj_method(sel_getUid("removeWindowController:"),function(_3a,_3b,_3c){
with(_3a){
if(_3c){
objj_msgSend(_windowControllers,"removeObject:",_3c);
}
if(objj_msgSend(_3c,"document")===_3a){
objj_msgSend(_3c,"setDocument:",nil);
}
}
}),new objj_method(sel_getUid("view"),function(_3d,_3e){
with(_3d){
return _view;
}
}),new objj_method(sel_getUid("viewControllers"),function(_3f,_40){
with(_3f){
return objj_msgSend(_viewControllersForWindowControllers,"allValues");
}
}),new objj_method(sel_getUid("addViewController:forWindowController:"),function(_41,_42,_43,_44){
with(_41){
objj_msgSend(_viewControllersForWindowControllers,"setObject:forKey:",_43,objj_msgSend(_44,"UID"));
if(objj_msgSend(_44,"document")===_41){
objj_msgSend(_44,"setViewController:",_43);
}
}
}),new objj_method(sel_getUid("removeViewController:"),function(_45,_46,_47){
with(_45){
objj_msgSend(_viewControllersForWindowControllers,"removeObject:",_47);
}
}),new objj_method(sel_getUid("viewControllerForWindowController:"),function(_48,_49,_4a){
with(_48){
return objj_msgSend(_viewControllersForWindowControllers,"objectForKey:",objj_msgSend(_4a,"UID"));
}
}),new objj_method(sel_getUid("showWindows"),function(_4b,_4c){
with(_4b){
objj_msgSend(_windowControllers,"makeObjectsPerformSelector:withObject:",sel_getUid("setDocument:"),_4b);
objj_msgSend(_windowControllers,"makeObjectsPerformSelector:withObject:",sel_getUid("showWindow:"),_4b);
}
}),new objj_method(sel_getUid("displayName"),function(_4d,_4e){
with(_4d){
if(_fileURL){
return objj_msgSend(_fileURL,"lastPathComponent");
}
if(!_untitledDocumentIndex){
_untitledDocumentIndex=++_1;
}
if(_untitledDocumentIndex==1){
return "Untitled";
}
return "Untitled "+_untitledDocumentIndex;
}
}),new objj_method(sel_getUid("viewCibName"),function(_4f,_50){
with(_4f){
return nil;
}
}),new objj_method(sel_getUid("windowCibName"),function(_51,_52){
with(_51){
return nil;
}
}),new objj_method(sel_getUid("windowControllerDidLoadCib:"),function(_53,_54,_55){
with(_53){
}
}),new objj_method(sel_getUid("windowControllerWillLoadCib:"),function(_56,_57,_58){
with(_56){
}
}),new objj_method(sel_getUid("readFromURL:ofType:delegate:didReadSelector:contextInfo:"),function(_59,_5a,_5b,_5c,_5d,_5e,_5f){
with(_59){
objj_msgSend(_readConnection,"cancel");
_readConnection=objj_msgSend(CPURLConnection,"connectionWithRequest:delegate:",objj_msgSend(CPURLRequest,"requestWithURL:",_5b),_59);
_readConnection.session=_60(_5c,_5d,_5e,_5f);
}
}),new objj_method(sel_getUid("fileURL"),function(_61,_62){
with(_61){
return _fileURL;
}
}),new objj_method(sel_getUid("setFileURL:"),function(_63,_64,_65){
with(_63){
if(_fileURL===_65){
return;
}
_fileURL=_65;
objj_msgSend(_windowControllers,"makeObjectsPerformSelector:",sel_getUid("synchronizeWindowTitleWithDocumentName"));
}
}),new objj_method(sel_getUid("saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:"),function(_66,_67,_68,_69,_6a,_6b,_6c,_6d){
with(_66){
var _6e=objj_msgSend(_66,"dataOfType:error:",objj_msgSend(_66,"fileType"),nil),_6f=_changeCount;
_writeRequest=objj_msgSend(CPURLRequest,"requestWithURL:",_68);
if(objj_msgSend(CPPlatform,"isBrowser")){
objj_msgSend(_writeRequest,"setHTTPMethod:","POST");
}else{
objj_msgSend(_writeRequest,"setHTTPMethod:","PUT");
}
objj_msgSend(_writeRequest,"setHTTPBody:",objj_msgSend(_6e,"rawString"));
objj_msgSend(_writeRequest,"setValue:forHTTPHeaderField:","close","Connection");
if(_6a==CPSaveOperation){
objj_msgSend(_writeRequest,"setValue:forHTTPHeaderField:","true","x-cappuccino-overwrite");
}
if(_6a!=CPSaveToOperation){
objj_msgSend(_66,"updateChangeCount:",CPChangeCleared);
}
var _70=objj_msgSend(CPURLConnection,"connectionWithRequest:delegate:",_writeRequest,_66);
_70.session=_71(_68,_6a,_6f,_6b,_6c,_6d,_70);
}
}),new objj_method(sel_getUid("connection:didReceiveResponse:"),function(_72,_73,_74,_75){
with(_72){
if(!objj_msgSend(_75,"isKindOfClass:",objj_msgSend(CPHTTPURLResponse,"class"))){
return;
}
var _76=objj_msgSend(_75,"statusCode");
if(_76===200){
return;
}
var _77=_74.session;
if(_74==_readConnection){
objj_msgSend(_74,"cancel");
alert("There was an error retrieving the document.");
objj_msgSend(_77.delegate,_77.didReadSelector,_72,NO,_77.contextInfo);
}else{
if(_76==409){
objj_msgSend(_74,"cancel");
if(confirm("There already exists a file with that name, would you like to overwrite it?")){
objj_msgSend(_writeRequest,"setValue:forHTTPHeaderField:","true","x-cappuccino-overwrite");
objj_msgSend(_74,"start");
}else{
if(_77.saveOperation!=CPSaveToOperation){
_changeCount+=_77.changeCount;
objj_msgSend(_windowControllers,"makeObjectsPerformSelector:withObject:",sel_getUid("setDocumentEdited:"),objj_msgSend(_72,"isDocumentEdited"));
}
_writeRequest=nil;
objj_msgSend(_77.delegate,_77.didSaveSelector,_72,NO,_77.contextInfo);
objj_msgSend(_72,"_sendDocumentSavedNotification:",NO);
}
}
}
}
}),new objj_method(sel_getUid("connection:didReceiveData:"),function(_78,_79,_7a,_7b){
with(_78){
var _7c=_7a.session;
if(_7a==_readConnection){
objj_msgSend(_78,"readFromData:ofType:error:",objj_msgSend(CPData,"dataWithRawString:",_7b),_7c.fileType,nil);
objj_msgSend(_7c.delegate,_7c.didReadSelector,_78,YES,_7c.contextInfo);
}else{
if(_7c.saveOperation!=CPSaveToOperation){
objj_msgSend(_78,"setFileURL:",_7c.absoluteURL);
}
_writeRequest=nil;
objj_msgSend(_7c.delegate,_7c.didSaveSelector,_78,YES,_7c.contextInfo);
objj_msgSend(_78,"_sendDocumentSavedNotification:",YES);
}
}
}),new objj_method(sel_getUid("connection:didFailWithError:"),function(_7d,_7e,_7f,_80){
with(_7d){
var _81=_7f.session;
if(_readConnection==_7f){
objj_msgSend(_81.delegate,_81.didReadSelector,_7d,NO,_81.contextInfo);
}else{
if(_81.saveOperation!=CPSaveToOperation){
_changeCount+=_81.changeCount;
objj_msgSend(_windowControllers,"makeObjectsPerformSelector:withObject:",sel_getUid("setDocumentEdited:"),objj_msgSend(_7d,"isDocumentEdited"));
}
_writeRequest=nil;
alert("There was an error saving the document.");
objj_msgSend(_81.delegate,_81.didSaveSelector,_7d,NO,_81.contextInfo);
objj_msgSend(_7d,"_sendDocumentSavedNotification:",NO);
}
}
}),new objj_method(sel_getUid("connectionDidFinishLoading:"),function(_82,_83,_84){
with(_82){
if(_readConnection==_84){
_readConnection=nil;
}
}
}),new objj_method(sel_getUid("isDocumentEdited"),function(_85,_86){
with(_85){
return _changeCount!=0;
}
}),new objj_method(sel_getUid("updateChangeCount:"),function(_87,_88,_89){
with(_87){
if(_89==CPChangeDone){
++_changeCount;
}else{
if(_89==CPChangeUndone){
--_changeCount;
}else{
if(_89==CPChangeCleared){
_changeCount=0;
}
}
}
objj_msgSend(_windowControllers,"makeObjectsPerformSelector:withObject:",sel_getUid("setDocumentEdited:"),objj_msgSend(_87,"isDocumentEdited"));
}
}),new objj_method(sel_getUid("setFileType:"),function(_8a,_8b,_8c){
with(_8a){
_fileType=_8c;
}
}),new objj_method(sel_getUid("fileType"),function(_8d,_8e){
with(_8d){
return _fileType;
}
}),new objj_method(sel_getUid("hasUndoManager"),function(_8f,_90){
with(_8f){
return _hasUndoManager;
}
}),new objj_method(sel_getUid("setHasUndoManager:"),function(_91,_92,_93){
with(_91){
if(_hasUndoManager==_93){
return;
}
_hasUndoManager=_93;
if(!_hasUndoManager){
objj_msgSend(_91,"setUndoManager:",nil);
}
}
}),new objj_method(sel_getUid("_undoManagerWillCloseGroup:"),function(_94,_95,_96){
with(_94){
var _97=objj_msgSend(_96,"object");
if(objj_msgSend(_97,"isUndoing")||objj_msgSend(_97,"isRedoing")){
return;
}
objj_msgSend(_94,"updateChangeCount:",CPChangeDone);
}
}),new objj_method(sel_getUid("_undoManagerDidUndoChange:"),function(_98,_99,_9a){
with(_98){
objj_msgSend(_98,"updateChangeCount:",CPChangeUndone);
}
}),new objj_method(sel_getUid("_undoManagerDidRedoChange:"),function(_9b,_9c,_9d){
with(_9b){
objj_msgSend(_9b,"updateChangeCount:",CPChangeDone);
}
}),new objj_method(sel_getUid("setUndoManager:"),function(_9e,_9f,_a0){
with(_9e){
var _a1=objj_msgSend(CPNotificationCenter,"defaultCenter");
if(_undoManager){
objj_msgSend(_a1,"removeObserver:name:object:",_9e,CPUndoManagerDidUndoChangeNotification,_undoManager);
objj_msgSend(_a1,"removeObserver:name:object:",_9e,CPUndoManagerDidRedoChangeNotification,_undoManager);
objj_msgSend(_a1,"removeObserver:name:object:",_9e,CPUndoManagerWillCloseUndoGroupNotification,_undoManager);
}
_undoManager=_a0;
if(_undoManager){
objj_msgSend(_a1,"addObserver:selector:name:object:",_9e,sel_getUid("_undoManagerDidUndoChange:"),CPUndoManagerDidUndoChangeNotification,_undoManager);
objj_msgSend(_a1,"addObserver:selector:name:object:",_9e,sel_getUid("_undoManagerDidRedoChange:"),CPUndoManagerDidRedoChangeNotification,_undoManager);
objj_msgSend(_a1,"addObserver:selector:name:object:",_9e,sel_getUid("_undoManagerWillCloseGroup:"),CPUndoManagerWillCloseUndoGroupNotification,_undoManager);
}
}
}),new objj_method(sel_getUid("undoManager"),function(_a2,_a3){
with(_a2){
if(_hasUndoManager&&!_undoManager){
objj_msgSend(_a2,"setUndoManager:",objj_msgSend(objj_msgSend(CPUndoManager,"alloc"),"init"));
}
return _undoManager;
}
}),new objj_method(sel_getUid("windowWillReturnUndoManager:"),function(_a4,_a5,_a6){
with(_a4){
return objj_msgSend(_a4,"undoManager");
}
}),new objj_method(sel_getUid("saveDocument:"),function(_a7,_a8,_a9){
with(_a7){
objj_msgSend(_a7,"saveDocumentWithDelegate:didSaveSelector:contextInfo:",nil,nil,nil);
}
}),new objj_method(sel_getUid("saveDocumentWithDelegate:didSaveSelector:contextInfo:"),function(_aa,_ab,_ac,_ad,_ae){
with(_aa){
if(_fileURL){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPDocumentWillSaveNotification,_aa);
objj_msgSend(_aa,"saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:",_fileURL,objj_msgSend(_aa,"fileType"),CPSaveOperation,_ac,_ad,_ae);
}else{
objj_msgSend(_aa,"_saveDocumentAsWithDelegate:didSaveSelector:contextInfo:",_ac,_ad,_ae);
}
}
}),new objj_method(sel_getUid("saveDocumentAs:"),function(_af,_b0,_b1){
with(_af){
objj_msgSend(_af,"_saveDocumentAsWithDelegate:didSaveSelector:contextInfo:",nil,nil,nil);
}
}),new objj_method(sel_getUid("_saveDocumentAsWithDelegate:didSaveSelector:contextInfo:"),function(_b2,_b3,_b4,_b5,_b6){
with(_b2){
var _b7=objj_msgSend(CPSavePanel,"savePanel"),_b8=objj_msgSend(_b7,"runModal");
if(!_b8){
return;
}
var _b9=objj_msgSend(_b7,"URL");
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPDocumentWillSaveNotification,_b2);
objj_msgSend(_b2,"saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:",_b9,objj_msgSend(_b2,"fileType"),CPSaveAsOperation,_b4,_b5,_b6);
}
}),new objj_method(sel_getUid("_sendDocumentSavedNotification:"),function(_ba,_bb,_bc){
with(_ba){
if(_bc){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPDocumentDidSaveNotification,_ba);
}else{
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPDocumentDidFailToSaveNotification,_ba);
}
}
})]);
var _2=objj_getClass("CPDocument");
if(!_2){
throw new SyntaxError("*** Could not find definition for class \"CPDocument\"");
}
var _3=_2.isa;
class_addMethods(_2,[new objj_method(sel_getUid("close"),function(_bd,_be){
with(_bd){
objj_msgSend(_windowControllers,"makeObjectsPerformSelector:withObject:",sel_getUid("removeDocumentAndCloseIfNecessary:"),_bd);
objj_msgSend(objj_msgSend(CPDocumentController,"sharedDocumentController"),"removeDocument:",_bd);
}
}),new objj_method(sel_getUid("shouldCloseWindowController:delegate:shouldCloseSelector:contextInfo:"),function(_bf,_c0,_c1,_c2,_c3,_c4){
with(_bf){
if(objj_msgSend(_c1,"shouldCloseDocument")||(objj_msgSend(_windowControllers,"count")<2&&objj_msgSend(_windowControllers,"indexOfObject:",_c1)!==CPNotFound)){
objj_msgSend(_bf,"canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:",_bf,sel_getUid("_document:shouldClose:context:"),{delegate:_c2,selector:_c3,context:_c4});
}else{
if(objj_msgSend(_c2,"respondsToSelector:",_c3)){
objj_msgSend(_c2,_c3,_bf,YES,_c4);
}
}
}
}),new objj_method(sel_getUid("_document:shouldClose:context:"),function(_c5,_c6,_c7,_c8,_c9){
with(_c5){
if(_c7===_c5&&_c8){
objj_msgSend(_c5,"close");
}
objj_msgSend(_c9.delegate,_c9.selector,_c7,_c8,_c9.context);
}
}),new objj_method(sel_getUid("canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:"),function(_ca,_cb,_cc,_cd,_ce){
with(_ca){
if(!objj_msgSend(_ca,"isDocumentEdited")){
return objj_msgSend(_cc,"respondsToSelector:",_cd)&&objj_msgSend(_cc,_cd,_ca,YES,_ce);
}
_canCloseAlert=objj_msgSend(objj_msgSend(CPAlert,"alloc"),"init");
objj_msgSend(_canCloseAlert,"setDelegate:",_ca);
objj_msgSend(_canCloseAlert,"setAlertStyle:",CPWarningAlertStyle);
objj_msgSend(_canCloseAlert,"setTitle:","Unsaved Document");
objj_msgSend(_canCloseAlert,"setMessageText:","Do you want to save the changes you've made to the document \""+(objj_msgSend(_ca,"displayName")||objj_msgSend(_ca,"fileName"))+"\"?");
objj_msgSend(_canCloseAlert,"addButtonWithTitle:","Save");
objj_msgSend(_canCloseAlert,"addButtonWithTitle:","Cancel");
objj_msgSend(_canCloseAlert,"addButtonWithTitle:","Don't Save");
_canCloseAlert._context={delegate:_cc,selector:_cd,context:_ce};
objj_msgSend(_canCloseAlert,"runModal");
}
}),new objj_method(sel_getUid("alertDidEnd:returnCode:"),function(_cf,_d0,_d1,_d2){
with(_cf){
if(_d1!==_canCloseAlert){
return;
}
var _d3=_d1._context.delegate,_d4=_d1._context.selector,_d5=_d1._context.context;
if(_d2===0){
objj_msgSend(_cf,"saveDocumentWithDelegate:didSaveSelector:contextInfo:",_d3,_d4,_d5);
}else{
objj_msgSend(_d3,_d4,_cf,_d2===2,_d5);
}
_canCloseAlert=nil;
}
})]);
var _60=function(_d6,_d7,_d8,_d9){
return {fileType:_d6,delegate:_d7,didReadSelector:_d8,contextInfo:_d9};
};
var _71=function(_da,_db,_dc,_dd,_de,_df,_e0){
return {absoluteURL:_da,saveOperation:_db,changeCount:_dc,delegate:_dd,didSaveSelector:_de,contextInfo:_df,connection:_e0};
};
p;22;CPDocumentController.jt;9691;@STATIC;1.0;I;21;Foundation/CPObject.jI;21;Foundation/CPBundle.ji;12;CPDocument.ji;13;CPOpenPanel.jt;9585;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("Foundation/CPBundle.j",NO);
objj_executeFile("CPDocument.j",YES);
objj_executeFile("CPOpenPanel.j",YES);
var _1=nil;
var _2=objj_allocateClassPair(CPObject,"CPDocumentController"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_documents"),new objj_ivar("_documentTypes")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("init"),function(_4,_5){
with(_4){
_4=objj_msgSendSuper({receiver:_4,super_class:objj_getClass("CPDocumentController").super_class},"init");
if(_4){
_documents=objj_msgSend(objj_msgSend(CPArray,"alloc"),"init");
if(!_1){
_1=_4;
}
_documentTypes=objj_msgSend(objj_msgSend(objj_msgSend(CPBundle,"mainBundle"),"infoDictionary"),"objectForKey:","CPBundleDocumentTypes");
}
return _4;
}
}),new objj_method(sel_getUid("documentForURL:"),function(_6,_7,_8){
with(_6){
var _9=0,_a=objj_msgSend(_documents,"count");
for(;_9<_a;++_9){
var _b=_documents[_9];
if(objj_msgSend(objj_msgSend(_b,"fileURL"),"isEqual:",_8)){
return _b;
}
}
return nil;
}
}),new objj_method(sel_getUid("openUntitledDocumentOfType:display:"),function(_c,_d,_e,_f){
with(_c){
var _10=objj_msgSend(_c,"makeUntitledDocumentOfType:error:",_e,nil);
if(_10){
objj_msgSend(_c,"addDocument:",_10);
}
if(_f){
objj_msgSend(_10,"makeWindowControllers");
objj_msgSend(_10,"showWindows");
}
return _10;
}
}),new objj_method(sel_getUid("makeUntitledDocumentOfType:error:"),function(_11,_12,_13,_14){
with(_11){
return objj_msgSend(objj_msgSend(objj_msgSend(_11,"documentClassForType:",_13),"alloc"),"initWithType:error:",_13,_14);
}
}),new objj_method(sel_getUid("openDocumentWithContentsOfURL:display:error:"),function(_15,_16,_17,_18,_19){
with(_15){
var _1a=objj_msgSend(_15,"documentForURL:",_17);
if(!_1a){
var _1b=objj_msgSend(_15,"typeForContentsOfURL:error:",_17,_19);
_1a=objj_msgSend(_15,"makeDocumentWithContentsOfURL:ofType:delegate:didReadSelector:contextInfo:",_17,_1b,_15,sel_getUid("document:didRead:contextInfo:"),objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",_18,"shouldDisplay"));
objj_msgSend(_15,"addDocument:",_1a);
if(_1a){
objj_msgSend(_15,"noteNewRecentDocument:",_1a);
}
}else{
if(_18){
objj_msgSend(_1a,"showWindows");
}
}
return _1a;
}
}),new objj_method(sel_getUid("reopenDocumentForURL:withContentsOfURL:error:"),function(_1c,_1d,_1e,_1f,_20){
with(_1c){
return objj_msgSend(_1c,"makeDocumentForURL:withContentsOfURL:ofType:delegate:didReadSelector:contextInfo:",_1e,_1f,objj_msgSend(objj_msgSend(_documentTypes,"objectAtIndex:",0),"objectForKey:","CPBundleTypeName"),_1c,sel_getUid("document:didRead:contextInfo:"),nil);
}
}),new objj_method(sel_getUid("makeDocumentWithContentsOfURL:ofType:delegate:didReadSelector:contextInfo:"),function(_21,_22,_23,_24,_25,_26,_27){
with(_21){
return objj_msgSend(objj_msgSend(objj_msgSend(_21,"documentClassForType:",_24),"alloc"),"initWithContentsOfURL:ofType:delegate:didReadSelector:contextInfo:",_23,_24,_25,_26,_27);
}
}),new objj_method(sel_getUid("makeDocumentForURL:withContentsOfURL:ofType:delegate:didReadSelector:contextInfo:"),function(_28,_29,_2a,_2b,_2c,_2d,_2e,_2f){
with(_28){
return objj_msgSend(objj_msgSend(objj_msgSend(_28,"documentClassForType:",_2c),"alloc"),"initForURL:withContentsOfURL:ofType:delegate:didReadSelector:contextInfo:",_2a,_2b,_2c,_2d,_2e,_2f);
}
}),new objj_method(sel_getUid("document:didRead:contextInfo:"),function(_30,_31,_32,_33,_34){
with(_30){
if(!_33){
return;
}
objj_msgSend(_32,"makeWindowControllers");
if(objj_msgSend(_34,"objectForKey:","shouldDisplay")){
objj_msgSend(_32,"showWindows");
}
}
}),new objj_method(sel_getUid("newDocument:"),function(_35,_36,_37){
with(_35){
objj_msgSend(_35,"openUntitledDocumentOfType:display:",objj_msgSend(objj_msgSend(_documentTypes,"objectAtIndex:",0),"objectForKey:","CPBundleTypeName"),YES);
}
}),new objj_method(sel_getUid("openDocument:"),function(_38,_39,_3a){
with(_38){
var _3b=objj_msgSend(CPOpenPanel,"openPanel");
objj_msgSend(_3b,"runModal");
var _3c=objj_msgSend(_3b,"URLs"),_3d=0,_3e=objj_msgSend(_3c,"count");
for(;_3d<_3e;++_3d){
objj_msgSend(_38,"openDocumentWithContentsOfURL:display:error:",objj_msgSend(CPURL,"URLWithString:",_3c[_3d]),YES,nil);
}
}
}),new objj_method(sel_getUid("documents"),function(_3f,_40){
with(_3f){
return _documents;
}
}),new objj_method(sel_getUid("addDocument:"),function(_41,_42,_43){
with(_41){
objj_msgSend(_documents,"addObject:",_43);
}
}),new objj_method(sel_getUid("removeDocument:"),function(_44,_45,_46){
with(_44){
objj_msgSend(_documents,"removeObjectIdenticalTo:",_46);
}
}),new objj_method(sel_getUid("defaultType"),function(_47,_48){
with(_47){
return objj_msgSend(_documentTypes[0],"objectForKey:","CPBundleTypeName");
}
}),new objj_method(sel_getUid("typeForContentsOfURL:error:"),function(_49,_4a,_4b,_4c){
with(_49){
var _4d=0,_4e=_documentTypes.length,_4f=objj_msgSend(objj_msgSend(_4b,"pathExtension"),"lowercaseString"),_50=nil;
for(;_4d<_4e;++_4d){
var _51=_documentTypes[_4d],_52=objj_msgSend(_51,"objectForKey:","CFBundleTypeExtensions"),_53=0,_54=_52.length;
for(;_53<_54;++_53){
var _55=objj_msgSend(_52[_53],"lowercaseString");
if(_55===_4f){
return objj_msgSend(_51,"objectForKey:","CPBundleTypeName");
}
if(_55==="****"){
_50=objj_msgSend(_51,"objectForKey:","CPBundleTypeName");
}
}
}
return _50||objj_msgSend(_49,"defaultType");
}
}),new objj_method(sel_getUid("_infoForType:"),function(_56,_57,_58){
with(_56){
var i=0,_59=objj_msgSend(_documentTypes,"count");
for(;i<_59;++i){
var _5a=_documentTypes[i];
if(objj_msgSend(_5a,"objectForKey:","CPBundleTypeName")==_58){
return _5a;
}
}
return nil;
}
}),new objj_method(sel_getUid("documentClassForType:"),function(_5b,_5c,_5d){
with(_5b){
var _5e=objj_msgSend(objj_msgSend(_5b,"_infoForType:",_5d),"objectForKey:","CPDocumentClass");
return _5e?CPClassFromString(_5e):nil;
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("sharedDocumentController"),function(_5f,_60){
with(_5f){
if(!_1){
objj_msgSend(objj_msgSend(_5f,"alloc"),"init");
}
return _1;
}
})]);
var _2=objj_getClass("CPDocumentController");
if(!_2){
throw new SyntaxError("*** Could not find definition for class \"CPDocumentController\"");
}
var _3=_2.isa;
class_addMethods(_2,[new objj_method(sel_getUid("closeAllDocumentsWithDelegate:didCloseAllSelector:contextInfo:"),function(_61,_62,_63,_64,_65){
with(_61){
var _66={delegate:_63,selector:_64,context:_65};
objj_msgSend(_61,"_closeDocumentsStartingWith:shouldClose:context:",nil,YES,_66);
}
}),new objj_method(sel_getUid("_closeDocumentsStartingWith:shouldClose:context:"),function(_67,_68,_69,_6a,_6b){
with(_67){
if(_6a){
objj_msgSend(_69,"close");
if(objj_msgSend(objj_msgSend(_67,"documents"),"count")>0){
objj_msgSend(objj_msgSend(objj_msgSend(_67,"documents"),"lastObject"),"canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:",_67,sel_getUid("_closeDocumentsStartingWith:shouldClose:context:"),_6b);
return;
}
}
if(objj_msgSend(_6b.delegate,"respondsToSelector:",_6b.selector)){
objj_msgSend(_6b.delegate,_6b.selector,_67,objj_msgSend(objj_msgSend(_67,"documents"),"count")===0,_6b.context);
}
}
})]);
var _2=objj_getClass("CPDocumentController");
if(!_2){
throw new SyntaxError("*** Could not find definition for class \"CPDocumentController\"");
}
var _3=_2.isa;
class_addMethods(_2,[new objj_method(sel_getUid("recentDocumentURLs"),function(_6c,_6d){
with(_6c){
if(typeof window["cpRecentDocumentURLs"]==="function"){
return window.cpRecentDocumentURLs();
}
return [];
}
}),new objj_method(sel_getUid("clearRecentDocuments:"),function(_6e,_6f,_70){
with(_6e){
if(typeof window["cpClearRecentDocuments"]==="function"){
window.cpClearRecentDocuments();
}
objj_msgSend(_6e,"_updateRecentDocumentsMenu");
}
}),new objj_method(sel_getUid("noteNewRecentDocument:"),function(_71,_72,_73){
with(_71){
objj_msgSend(_71,"noteNewRecentDocumentURL:",objj_msgSend(objj_msgSend(_73,"fileURL"),"absoluteString"));
}
}),new objj_method(sel_getUid("noteNewRecentDocumentURL:"),function(_74,_75,_76){
with(_74){
if(typeof window["cpNoteNewRecentDocumentPath"]==="function"){
window.cpNoteNewRecentDocumentPath(_76);
}
objj_msgSend(_74,"_updateRecentDocumentsMenu");
}
}),new objj_method(sel_getUid("_removeAllRecentDocumentsFromMenu:"),function(_77,_78,_79){
with(_77){
var _7a=objj_msgSend(_79,"itemArray"),_7b=objj_msgSend(_7a,"count");
while(_7b--){
var _7c=_7a[_7b];
if(objj_msgSend(_7c,"action")===sel_getUid("_openRecentDocument:")){
objj_msgSend(_79,"removeItemAtIndex:",_7b);
}
}
}
}),new objj_method(sel_getUid("_updateRecentDocumentsMenu"),function(_7d,_7e){
with(_7d){
var _7f=objj_msgSend(objj_msgSend(CPApp,"mainMenu"),"_menuWithName:","_CPRecentDocumentsMenu"),_80=objj_msgSend(_7d,"recentDocumentURLs"),_81=objj_msgSend(_7f,"itemArray"),_82=objj_msgSend(_80,"count"),_83=objj_msgSend(_81,"count");
objj_msgSend(_7d,"_removeAllRecentDocumentsFromMenu:",_7f);
if(_83){
if(!_82){
if(objj_msgSend(_81[0],"isSeparatorItem")){
objj_msgSend(_7f,"removeItemAtIndex:",0);
}
}else{
if(!objj_msgSend(_81[0],"isSeparatorItem")){
objj_msgSend(_7f,"insertItem:atIndex:",objj_msgSend(CPMenuItem,"separatorItem"),0);
}
}
}
while(_82--){
var _84=_80[_82],_85=objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:",objj_msgSend(_84,"lastPathComponent"),sel_getUid("_openRecentDocument:"),nil);
objj_msgSend(_85,"setTag:",_84);
objj_msgSend(_7f,"insertItem:atIndex:",_85,0);
}
}
}),new objj_method(sel_getUid("_openRecentDocument:"),function(_86,_87,_88){
with(_86){
objj_msgSend(_86,"openDocumentWithContentsOfURL:display:error:",objj_msgSend(_88,"tag"),YES,nil);
}
})]);
p;14;CPDragServer.jt;12433;@STATIC;1.0;I;15;AppKit/CPView.jI;16;AppKit/CPEvent.jI;21;AppKit/CPPasteboard.jI;20;AppKit/CPImageView.jt;12321;
objj_executeFile("AppKit/CPView.j",NO);
objj_executeFile("AppKit/CPEvent.j",NO);
objj_executeFile("AppKit/CPPasteboard.j",NO);
objj_executeFile("AppKit/CPImageView.j",NO);
CPDragOperationNone=0,CPDragOperationCopy=1<<1,CPDragOperationLink=1<<1,CPDragOperationGeneric=1<<2,CPDragOperationPrivate=1<<3,CPDragOperationMove=1<<4,CPDragOperationDelete=1<<5,CPDragOperationEvery=-1;
var _1=nil,_2=nil;
var _3=nil;
var _4=nil;
var _5=nil;
var _6=objj_allocateClassPair(CPObject,"CPDraggingInfo"),_7=_6.isa;
objj_registerClassPair(_6);
class_addMethods(_6,[new objj_method(sel_getUid("draggingPasteboard"),function(_8,_9){
with(_8){
if(objj_msgSend(CPPlatform,"supportsDragAndDrop")){
return objj_msgSend(_CPDOMDataTransferPasteboard,"DOMDataTransferPasteboard");
}
return objj_msgSend(objj_msgSend(CPDragServer,"sharedDragServer"),"draggingPasteboard");
}
}),new objj_method(sel_getUid("draggingSource"),function(_a,_b){
with(_a){
return objj_msgSend(objj_msgSend(CPDragServer,"sharedDragServer"),"draggingSource");
}
}),new objj_method(sel_getUid("draggingLocation"),function(_c,_d){
with(_c){
return objj_msgSend(objj_msgSend(CPDragServer,"sharedDragServer"),"draggingLocation");
}
}),new objj_method(sel_getUid("draggingDestinationWindow"),function(_e,_f){
with(_e){
return (objj_msgSend(objj_msgSend(objj_msgSend(CPDragServer,"sharedDragServer"),"draggingDestination"),"isKindOfClass:",objj_msgSend(CPWindow,"class"))?objj_msgSend(objj_msgSend(CPDragServer,"sharedDragServer"),"draggingDestination"):objj_msgSend(objj_msgSend(objj_msgSend(CPDragServer,"sharedDragServer"),"draggingDestination"),"window"));
}
}),new objj_method(sel_getUid("draggedImage"),function(_10,_11){
with(_10){
return objj_msgSend(objj_msgSend(_10,"draggedView"),"image");
}
}),new objj_method(sel_getUid("draggedImageLocation"),function(_12,_13){
with(_12){
return objj_msgSend(_12,"draggedViewLocation");
}
}),new objj_method(sel_getUid("draggedView"),function(_14,_15){
with(_14){
return objj_msgSend(objj_msgSend(CPDragServer,"sharedDragServer"),"draggedView");
}
}),new objj_method(sel_getUid("draggedViewLocation"),function(_16,_17){
with(_16){
var _18=objj_msgSend(CPDragServer,"sharedDragServer");
return objj_msgSend((objj_msgSend(objj_msgSend(_18,"draggingDestination"),"isKindOfClass:",objj_msgSend(CPWindow,"class"))?objj_msgSend(_18,"draggingDestination"):objj_msgSend(objj_msgSend(_18,"draggingDestination"),"window")),"convertPlatformWindowToBase:",objj_msgSend(objj_msgSend(_18,"draggedView"),"frame").origin);
}
})]);
var _19=1<<0,_1a=1<<1,_1b=1<<2,_1c=1<<3;
var _6=objj_allocateClassPair(CPObject,"CPDragServer"),_7=_6.isa;
class_addIvars(_6,[new objj_ivar("_isDragging"),new objj_ivar("_draggedWindow"),new objj_ivar("_draggedView"),new objj_ivar("_imageView"),new objj_ivar("_isDraggingImage"),new objj_ivar("_draggingOffset"),new objj_ivar("_draggingPasteboard"),new objj_ivar("_draggingSource"),new objj_ivar("_implementedDraggingSourceMethods"),new objj_ivar("_draggingLocation"),new objj_ivar("_draggingDestination"),new objj_ivar("_startDragLocation"),new objj_ivar("_shouldSlideBack"),new objj_ivar("_dragOperation")]);
objj_registerClassPair(_6);
class_addMethods(_6,[new objj_method(sel_getUid("isDragging"),function(_1d,_1e){
with(_1d){
return _isDragging;
}
}),new objj_method(sel_getUid("draggedWindow"),function(_1f,_20){
with(_1f){
return _draggedWindow;
}
}),new objj_method(sel_getUid("draggedView"),function(_21,_22){
with(_21){
return _draggedView;
}
}),new objj_method(sel_getUid("draggingOffset"),function(_23,_24){
with(_23){
return _draggingOffset;
}
}),new objj_method(sel_getUid("draggingPasteboard"),function(_25,_26){
with(_25){
return _draggingPasteboard;
}
}),new objj_method(sel_getUid("draggingSource"),function(_27,_28){
with(_27){
return _draggingSource;
}
}),new objj_method(sel_getUid("init"),function(_29,_2a){
with(_29){
_29=objj_msgSendSuper({receiver:_29,super_class:objj_getClass("CPDragServer").super_class},"init");
if(_29){
_draggedWindow=objj_msgSend(objj_msgSend(CPWindow,"alloc"),"initWithContentRect:styleMask:",{origin:{x:0,y:0},size:{width:0,height:0}},CPBorderlessWindowMask);
objj_msgSend(_draggedWindow,"setLevel:",CPDraggingWindowLevel);
}
return _29;
}
}),new objj_method(sel_getUid("draggingDestination"),function(_2b,_2c){
with(_2b){
return _draggingDestination;
}
}),new objj_method(sel_getUid("draggingLocation"),function(_2d,_2e){
with(_2d){
return _draggingLocation;
}
}),new objj_method(sel_getUid("draggingStartedInPlatformWindow:globalLocation:"),function(_2f,_30,_31,_32){
with(_2f){
if(_isDraggingImage){
if(objj_msgSend(_draggingSource,"respondsToSelector:",sel_getUid("draggedImage:beganAt:"))){
objj_msgSend(_draggingSource,"draggedImage:beganAt:",objj_msgSend(_draggedView,"image"),_32);
}
}else{
if(objj_msgSend(_draggingSource,"respondsToSelector:",sel_getUid("draggedView:beganAt:"))){
objj_msgSend(_draggingSource,"draggedView:beganAt:",_draggedView,_32);
}
}
if(!objj_msgSend(CPPlatform,"supportsDragAndDrop")){
objj_msgSend(_draggedWindow,"orderFront:",_2f);
}
}
}),new objj_method(sel_getUid("draggingSourceUpdatedWithGlobalLocation:"),function(_33,_34,_35){
with(_33){
if(!objj_msgSend(CPPlatform,"supportsDragAndDrop")){
objj_msgSend(_draggedWindow,"setFrameOrigin:",{x:_35.x-_draggingOffset.width,y:_35.y-_draggingOffset.height});
}
if(_implementedDraggingSourceMethods&_19){
objj_msgSend(_draggingSource,"draggedImage:movedTo:",objj_msgSend(_draggedView,"image"),_35);
}else{
if(_implementedDraggingSourceMethods&_1b){
objj_msgSend(_draggingSource,"draggedView:movedTo:",_draggedView,_35);
}
}
}
}),new objj_method(sel_getUid("draggingUpdatedInPlatformWindow:location:"),function(_36,_37,_38,_39){
with(_36){
var _3a=CPDragOperationCopy;
var _3b=objj_msgSend(_38,"_dragHitTest:pasteboard:",_39,objj_msgSend(_5,"draggingPasteboard"));
if(_3b){
_draggingLocation=objj_msgSend((objj_msgSend(_3b,"isKindOfClass:",objj_msgSend(CPWindow,"class"))?_3b:objj_msgSend(_3b,"window")),"convertPlatformWindowToBase:",_39);
}
if(_3b!==_draggingDestination){
if(_draggingDestination&&objj_msgSend(_draggingDestination,"respondsToSelector:",sel_getUid("draggingExited:"))){
objj_msgSend(_draggingDestination,"draggingExited:",_5);
}
_draggingDestination=_3b;
if(_draggingDestination&&objj_msgSend(_draggingDestination,"respondsToSelector:",sel_getUid("draggingEntered:"))){
_3a=objj_msgSend(_draggingDestination,"draggingEntered:",_5);
}
}else{
if(_draggingDestination&&objj_msgSend(_draggingDestination,"respondsToSelector:",sel_getUid("draggingUpdated:"))){
_3a=objj_msgSend(_draggingDestination,"draggingUpdated:",_5);
}
}
if(!_draggingDestination){
_3a=CPDragOperationNone;
}
return _3a;
}
}),new objj_method(sel_getUid("draggingEndedInPlatformWindow:globalLocation:operation:"),function(_3c,_3d,_3e,_3f,_40){
with(_3c){
objj_msgSend(_draggedView,"removeFromSuperview");
if(!objj_msgSend(CPPlatform,"supportsDragAndDrop")){
objj_msgSend(_draggedWindow,"orderOut:",_3c);
}
if(_implementedDraggingSourceMethods&_1a){
objj_msgSend(_draggingSource,"draggedImage:endedAt:operation:",objj_msgSend(_draggedView,"image"),_3f,_40);
}else{
if(_implementedDraggingSourceMethods&_1c){
objj_msgSend(_draggingSource,"draggedView:endedAt:operation:",_draggedView,_3f,_40);
}
}
_isDragging=NO;
}
}),new objj_method(sel_getUid("performDragOperationInPlatformWindow:"),function(_41,_42,_43){
with(_41){
if(_draggingDestination&&(!objj_msgSend(_draggingDestination,"respondsToSelector:",sel_getUid("prepareForDragOperation:"))||objj_msgSend(_draggingDestination,"prepareForDragOperation:",_5))&&(!objj_msgSend(_draggingDestination,"respondsToSelector:",sel_getUid("performDragOperation:"))||objj_msgSend(_draggingDestination,"performDragOperation:",_5))&&objj_msgSend(_draggingDestination,"respondsToSelector:",sel_getUid("concludeDragOperation:"))){
objj_msgSend(_draggingDestination,"concludeDragOperation:",_5);
}
}
}),new objj_method(sel_getUid("dragView:fromWindow:at:offset:event:pasteboard:source:slideBack:"),function(_44,_45,_46,_47,_48,_49,_4a,_4b,_4c,_4d){
with(_44){
_isDragging=YES;
_draggedView=_46;
_draggingPasteboard=_4b||objj_msgSend(CPPasteboard,"pasteboardWithName:",CPDragPboard);
_draggingSource=_4c;
_draggingDestination=nil;
_shouldSlideBack=_4d;
var _4e=objj_msgSend(_4a,"window"),_4f=objj_msgSend(_4a,"locationInWindow");
if(_4f){
if(_4e){
_4f=objj_msgSend(_4e,"convertBaseToGlobal:",_4f);
}
_draggingOffset={width:_4f.x-_48.x,height:_4f.y-_48.y};
}else{
_draggingOffset={width:0,height:0};
}
if(objj_msgSend(CPPlatform,"isBrowser")){
objj_msgSend(_draggedWindow,"setPlatformWindow:",objj_msgSend(_47,"platformWindow"));
}
objj_msgSend(_46,"setFrameOrigin:",{x:0,y:0});
var _50=objj_msgSend(CPEvent,"mouseLocation");
_startDragLocation={x:_50.x-_draggingOffset.width,y:_50.y-_draggingOffset.height};
objj_msgSend(_draggedWindow,"setFrameOrigin:",_startDragLocation);
objj_msgSend(_draggedWindow,"setFrameSize:",objj_msgSend(_46,"frame").size);
objj_msgSend(objj_msgSend(_draggedWindow,"contentView"),"addSubview:",_46);
_implementedDraggingSourceMethods=0;
if(_draggedView===_imageView){
if(objj_msgSend(_draggingSource,"respondsToSelector:",sel_getUid("draggedImage:movedTo:"))){
_implementedDraggingSourceMethods|=_19;
}
if(objj_msgSend(_draggingSource,"respondsToSelector:",sel_getUid("draggedImage:endAt:operation:"))){
_implementedDraggingSourceMethods|=_1a;
}
}else{
if(objj_msgSend(_draggingSource,"respondsToSelector:",sel_getUid("draggedView:movedTo:"))){
_implementedDraggingSourceMethods|=_1b;
}
if(objj_msgSend(_draggingSource,"respondsToSelector:",sel_getUid("draggedView:endedAt:operation:"))){
_implementedDraggingSourceMethods|=_1c;
}
}
if(!objj_msgSend(CPPlatform,"supportsDragAndDrop")){
objj_msgSend(_44,"draggingStartedInPlatformWindow:globalLocation:",objj_msgSend(_47,"platformWindow"),_50);
objj_msgSend(_44,"trackDragging:",_4a);
}
}
}),new objj_method(sel_getUid("dragImage:fromWindow:at:offset:event:pasteboard:source:slideBack:"),function(_51,_52,_53,_54,_55,_56,_57,_58,_59,_5a){
with(_51){
_isDraggingImage=YES;
var _5b=objj_msgSend(_53,"size");
if(!_imageView){
_imageView=objj_msgSend(objj_msgSend(CPImageView,"alloc"),"initWithFrame:",{origin:{x:0,y:0},size:{width:_5b.width,height:_5b.height}});
}
objj_msgSend(_imageView,"setImage:",_53);
objj_msgSend(_51,"dragView:fromWindow:at:offset:event:pasteboard:source:slideBack:",_imageView,_54,_55,_56,_57,_58,_59,_5a);
}
}),new objj_method(sel_getUid("trackDragging:"),function(_5c,_5d,_5e){
with(_5c){
var _5f=objj_msgSend(_5e,"type"),_60=objj_msgSend(_draggedWindow,"platformWindow"),_61=objj_msgSend(objj_msgSend(_5e,"window"),"convertBaseToPlatformWindow:",objj_msgSend(_5e,"locationInWindow"));
if(_5f===CPLeftMouseUp){
if(_dragOperation!==CPDragOperationNone){
objj_msgSend(_5c,"performDragOperationInPlatformWindow:",_60);
}
objj_msgSend(_5c,"draggingEndedInPlatformWindow:globalLocation:operation:",_60,_61,_dragOperation);
return;
}
objj_msgSend(_5c,"draggingSourceUpdatedWithGlobalLocation:",_61);
_dragOperation=objj_msgSend(_5c,"draggingUpdatedInPlatformWindow:location:",_60,_61);
objj_msgSend(CPApp,"setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:",_5c,sel_getUid("trackDragging:"),CPMouseMovedMask|CPLeftMouseDraggedMask|CPLeftMouseUpMask,nil,0,NO);
}
})]);
class_addMethods(_7,[new objj_method(sel_getUid("initialize"),function(_62,_63){
with(_62){
if(_62!==objj_msgSend(CPDragServer,"class")){
return;
}
_5=objj_msgSend(objj_msgSend(CPDraggingInfo,"alloc"),"init");
}
}),new objj_method(sel_getUid("sharedDragServer"),function(_64,_65){
with(_64){
if(!_3){
_3=objj_msgSend(objj_msgSend(CPDragServer,"alloc"),"init");
}
return _3;
}
})]);
var _6=objj_getClass("CPWindow");
if(!_6){
throw new SyntaxError("*** Could not find definition for class \"CPWindow\"");
}
var _7=_6.isa;
class_addMethods(_6,[new objj_method(sel_getUid("_dragHitTest:pasteboard:"),function(_66,_67,_68,_69){
with(_66){
if(!_inclusiveRegisteredDraggedTypes){
return nil;
}
var _6a=objj_msgSend(_66,"convertPlatformWindowToBase:",_68),_6b=objj_msgSend(_windowView,"hitTest:",_6a);
while(_6b&&!objj_msgSend(_69,"availableTypeFromArray:",objj_msgSend(_6b,"registeredDraggedTypes"))){
_6b=objj_msgSend(_6b,"superview");
}
if(_6b){
return _6b;
}
if(objj_msgSend(_69,"availableTypeFromArray:",objj_msgSend(_66,"registeredDraggedTypes"))){
return _66;
}
return nil;
}
})]);
p;9;CPEvent.jt;8889;@STATIC;1.0;I;21;Foundation/CPObject.jt;8844;
objj_executeFile("Foundation/CPObject.j",NO);
CPLeftMouseDown=1;
CPLeftMouseUp=2;
CPRightMouseDown=3;
CPRightMouseUp=4;
CPMouseMoved=5;
CPLeftMouseDragged=6;
CPRightMouseDragged=7;
CPMouseEntered=8;
CPMouseExited=9;
CPKeyDown=10;
CPKeyUp=11;
CPFlagsChanged=12;
CPAppKitDefined=13;
CPSystemDefined=14;
CPApplicationDefined=15;
CPPeriodic=16;
CPCursorUpdate=17;
CPScrollWheel=22;
CPOtherMouseDown=25;
CPOtherMouseUp=26;
CPOtherMouseDragged=27;
CPTouchStart=28;
CPTouchMove=29;
CPTouchEnd=30;
CPTouchCancel=31;
CPAlphaShiftKeyMask=1<<16;
CPShiftKeyMask=1<<17;
CPControlKeyMask=1<<18;
CPAlternateKeyMask=1<<19;
CPCommandKeyMask=1<<20;
CPNumericPadKeyMask=1<<21;
CPHelpKeyMask=1<<22;
CPFunctionKeyMask=1<<23;
CPDeviceIndependentModifierFlagsMask=4294901760;
CPLeftMouseDownMask=1<<CPLeftMouseDown;
CPLeftMouseUpMask=1<<CPLeftMouseUp;
CPRightMouseDownMask=1<<CPRightMouseDown;
CPRightMouseUpMask=1<<CPRightMouseUp;
CPOtherMouseDownMask=1<<CPOtherMouseDown;
CPOtherMouseUpMask=1<<CPOtherMouseUp;
CPMouseMovedMask=1<<CPMouseMoved;
CPLeftMouseDraggedMask=1<<CPLeftMouseDragged;
CPRightMouseDraggedMask=1<<CPRightMouseDragged;
CPOtherMouseDragged=1<<CPOtherMouseDragged;
CPMouseEnteredMask=1<<CPMouseEntered;
CPMouseExitedMask=1<<CPMouseExited;
CPCursorUpdateMask=1<<CPCursorUpdate;
CPKeyDownMask=1<<CPKeyDown;
CPKeyUpMask=1<<CPKeyUp;
CPFlagsChangedMask=1<<CPFlagsChanged;
CPAppKitDefinedMask=1<<CPAppKitDefined;
CPSystemDefinedMask=1<<CPSystemDefined;
CPApplicationDefinedMask=1<<CPApplicationDefined;
CPPeriodicMask=1<<CPPeriodic;
CPScrollWheelMask=1<<CPScrollWheel;
CPAnyEventMask=4294967295;
CPDOMEventDoubleClick="dblclick",CPDOMEventMouseDown="mousedown",CPDOMEventMouseUp="mouseup",CPDOMEventMouseMoved="mousemove",CPDOMEventMouseDragged="mousedrag",CPDOMEventKeyUp="keyup",CPDOMEventKeyDown="keydown",CPDOMEventKeyPress="keypress";
CPDOMEventCopy="copy";
CPDOMEventPaste="paste";
CPDOMEventScrollWheel="mousewheel";
CPDOMEventTouchStart="touchstart";
CPDOMEventTouchMove="touchmove";
CPDOMEventTouchEnd="touchend";
CPDOMEventTouchCancel="touchcancel";
var _1=0,_2=nil;
var _3=objj_allocateClassPair(CPObject,"CPEvent"),_4=_3.isa;
class_addIvars(_3,[new objj_ivar("_type"),new objj_ivar("_location"),new objj_ivar("_modifierFlags"),new objj_ivar("_timestamp"),new objj_ivar("_context"),new objj_ivar("_eventNumber"),new objj_ivar("_clickCount"),new objj_ivar("_pressure"),new objj_ivar("_window"),new objj_ivar("_windowNumber"),new objj_ivar("_characters"),new objj_ivar("_isARepeat"),new objj_ivar("_keyCode"),new objj_ivar("_DOMEvent"),new objj_ivar("_deltaX"),new objj_ivar("_deltaY"),new objj_ivar("_deltaZ")]);
objj_registerClassPair(_3);
class_addMethods(_3,[new objj_method(sel_getUid("_initMouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:"),function(_5,_6,_7,_8,_9,_a,_b,_c,_d,_e,_f){
with(_5){
_5=objj_msgSendSuper({receiver:_5,super_class:objj_getClass("CPEvent").super_class},"init");
if(_5){
_type=_7;
_location=CPPointCreateCopy(_8);
_modifierFlags=_9;
_timestamp=_a;
_context=_c;
_eventNumber=_d;
_clickCount=_e;
_pressure=_f;
_window=objj_msgSend(CPApp,"windowWithWindowNumber:",_b);
}
return _5;
}
}),new objj_method(sel_getUid("_initKeyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:"),function(_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_1a,_1b){
with(_10){
_10=objj_msgSendSuper({receiver:_10,super_class:objj_getClass("CPEvent").super_class},"init");
if(_10){
_type=_12;
_location=CPPointCreateCopy(_13);
_modifierFlags=_14;
_timestamp=_15;
_context=_17;
_characters=_18;
_charactersIgnoringModifiers=_19;
_isARepeat=_1a;
_keyCode=_1b;
_windowNumber=_16;
}
return _10;
}
}),new objj_method(sel_getUid("_initOtherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:"),function(_1c,_1d,_1e,_1f,_20,_21,_22,_23,_24,_25,_26){
with(_1c){
_1c=objj_msgSendSuper({receiver:_1c,super_class:objj_getClass("CPEvent").super_class},"init");
if(_1c){
_type=_1e;
_location=CPPointCreateCopy(_1f);
_modifierFlags=_20;
_timestamp=_21;
_context=_23;
_subtype=_24;
_data1=_25;
_data2=_26;
}
return _1c;
}
}),new objj_method(sel_getUid("locationInWindow"),function(_27,_28){
with(_27){
return {x:_location.x,y:_location.y};
}
}),new objj_method(sel_getUid("globalLocation"),function(_29,_2a){
with(_29){
var _2b=objj_msgSend(_29,"window"),_2c=objj_msgSend(_29,"locationInWindow");
if(_2b){
return objj_msgSend(_2b,"convertBaseToGlobal:",_2c);
}
return _2c;
}
}),new objj_method(sel_getUid("modifierFlags"),function(_2d,_2e){
with(_2d){
return _modifierFlags;
}
}),new objj_method(sel_getUid("timestamp"),function(_2f,_30){
with(_2f){
return _timestamp;
}
}),new objj_method(sel_getUid("type"),function(_31,_32){
with(_31){
return _type;
}
}),new objj_method(sel_getUid("window"),function(_33,_34){
with(_33){
if(!_window){
_window=objj_msgSend(CPApp,"windowWithWindowNumber:",_windowNumber);
}
return _window;
}
}),new objj_method(sel_getUid("windowNumber"),function(_35,_36){
with(_35){
return _windowNumber;
}
}),new objj_method(sel_getUid("buttonNumber"),function(_37,_38){
with(_37){
return _buttonNumber;
}
}),new objj_method(sel_getUid("clickCount"),function(_39,_3a){
with(_39){
return _clickCount;
}
}),new objj_method(sel_getUid("characters"),function(_3b,_3c){
with(_3b){
return _characters;
}
}),new objj_method(sel_getUid("charactersIgnoringModifiers"),function(_3d,_3e){
with(_3d){
return _charactersIgnoringModifiers;
}
}),new objj_method(sel_getUid("isARepeat"),function(_3f,_40){
with(_3f){
return _isARepeat;
}
}),new objj_method(sel_getUid("keyCode"),function(_41,_42){
with(_41){
return _keyCode;
}
}),new objj_method(sel_getUid("pressure"),function(_43,_44){
with(_43){
return _pressure;
}
}),new objj_method(sel_getUid("_DOMEvent"),function(_45,_46){
with(_45){
return _DOMEvent;
}
}),new objj_method(sel_getUid("deltaX"),function(_47,_48){
with(_47){
return _deltaX;
}
}),new objj_method(sel_getUid("deltaY"),function(_49,_4a){
with(_49){
return _deltaY;
}
}),new objj_method(sel_getUid("deltaZ"),function(_4b,_4c){
with(_4b){
return _deltaZ;
}
}),new objj_method(sel_getUid("_couldBeKeyEquivalent"),function(_4d,_4e){
with(_4d){
return _type===CPKeyDown&&_modifierFlags&(CPCommandKeyMask|CPControlKeyMask)&&objj_msgSend(_characters,"length")>0;
}
})]);
class_addMethods(_4,[new objj_method(sel_getUid("keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:"),function(_4f,_50,_51,_52,_53,_54,_55,_56,_57,_58,_59,_5a){
with(_4f){
return objj_msgSend(objj_msgSend(_4f,"alloc"),"_initKeyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:",_51,_52,_53,_54,_55,_56,_57,_58,_59,_5a);
}
}),new objj_method(sel_getUid("mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:"),function(_5b,_5c,_5d,_5e,_5f,_60,_61,_62,_63,_64,_65){
with(_5b){
return objj_msgSend(objj_msgSend(_5b,"alloc"),"_initMouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:",_5d,_5e,_5f,_60,_61,_62,_63,_64,_65);
}
}),new objj_method(sel_getUid("otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:"),function(_66,_67,_68,_69,_6a,_6b,_6c,_6d,_6e,_6f,_70){
with(_66){
return objj_msgSend(objj_msgSend(_66,"alloc"),"_initOtherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:",_68,_69,_6a,_6b,_6c,_6d,_6e,_6f,_70);
}
}),new objj_method(sel_getUid("mouseLocation"),function(_71,_72){
with(_71){
var _73=objj_msgSend(CPApp,"currentEvent"),_74=objj_msgSend(_73,"window");
if(_74){
return objj_msgSend(_74,"convertBaseToGlobal:",objj_msgSend(_73,"locationInWindow"));
}
return objj_msgSend(_73,"locationInWindow");
}
}),new objj_method(sel_getUid("startPeriodicEventsAfterDelay:withPeriod:"),function(_75,_76,_77,_78){
with(_75){
_1=_78;
_2=window.setTimeout(function(){
_2=window.setInterval(_CPEventFirePeriodEvent,_78*1000);
},_77*1000);
}
}),new objj_method(sel_getUid("stopPeriodicEvents"),function(_79,_7a){
with(_79){
if(_2===nil){
return;
}
window.clearTimeout(_2);
_2=nil;
}
})]);
_CPEventFirePeriodEvent=function(){
objj_msgSend(CPApp,"sendEvent:",objj_msgSend(CPEvent,"otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:",CPPeriodic,{x:0,y:0},0,0,0,nil,0,0,0));
};
var _7b=objj_msgSend(CPEvent,"class");
_CPEventFromNativeMouseEvent=function(_7c,_7d,_7e,_7f,_80,_81,_82,_83,_84,_85){
_7c.isa=_7b;
_7c._type=_7d;
_7c._location=_7e;
_7c._modifierFlags=_7f;
_7c._timestamp=_80;
_7c._windowNumber=_81;
_7c._window=nil;
_7c._context=_82;
_7c._eventNumber=_83;
_7c._clickCount=_84;
_7c._pressure=_85;
return _7c;
};
p;14;CPFlashMovie.jt;1223;@STATIC;1.0;I;21;Foundation/CPObject.jt;1178;
objj_executeFile("Foundation/CPObject.j",NO);
var _1=objj_allocateClassPair(CPObject,"CPFlashMovie"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_filename")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithFile:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPFlashMovie").super_class},"init");
if(_3){
_filename=_5;
}
return _3;
}
}),new objj_method(sel_getUid("filename"),function(_6,_7){
with(_6){
return _filename;
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("flashMovieWithFile:"),function(_8,_9,_a){
with(_8){
return objj_msgSend(objj_msgSend(_8,"alloc"),"initWithFile:",_a);
}
})]);
var _b="CPFlashMovieFilenameKey";
var _1=objj_getClass("CPFlashMovie");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPFlashMovie\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_c,_d,_e){
with(_c){
_filename=objj_msgSend(_e,"decodeObjectForKey:",_b);
return _c;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_f,_10,_11){
with(_f){
objj_msgSend(_11,"encodeObject:forKey:",_filename,_b);
}
})]);
p;13;CPFlashView.jt;4784;@STATIC;1.0;i;14;CPFlashMovie.ji;8;CPView.jt;4734;
objj_executeFile("CPFlashMovie.j",YES);
objj_executeFile("CPView.j",YES);
var _1="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
var _2=objj_allocateClassPair(CPView,"CPFlashView"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_flashMovie"),new objj_ivar("_params"),new objj_ivar("_paramElements"),new objj_ivar("_DOMParamElement"),new objj_ivar("_DOMObjectElement"),new objj_ivar("_DOMInnerObjectElement")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("initWithFrame:"),function(_4,_5,_6){
with(_4){
_4=objj_msgSendSuper({receiver:_4,super_class:objj_getClass("CPFlashView").super_class},"initWithFrame:",_6);
if(_4){
if(!CPBrowserIsEngine(CPInternetExplorerBrowserEngine)){
_DOMObjectElement=document.createElement("object");
_DOMObjectElement.width="100%";
_DOMObjectElement.height="100%";
_DOMObjectElement.style.top="0px";
_DOMObjectElement.style.left="0px";
_DOMObjectElement.type="application/x-shockwave-flash";
_DOMObjectElement.setAttribute("classid",_1);
_DOMParamElement=document.createElement("param");
_DOMParamElement.name="movie";
_DOMInnerObjectElement=document.createElement("object");
_DOMInnerObjectElement.width="100%";
_DOMInnerObjectElement.height="100%";
_DOMObjectElement.appendChild(_DOMParamElement);
_DOMObjectElement.appendChild(_DOMInnerObjectElement);
_DOMElement.appendChild(_DOMObjectElement);
}else{
objj_msgSend(_4,"_rebuildIEObjects");
}
}
return _4;
}
}),new objj_method(sel_getUid("setFlashMovie:"),function(_7,_8,_9){
with(_7){
if(_flashMovie==_9){
return;
}
_flashMovie=_9;
if(!CPBrowserIsEngine(CPInternetExplorerBrowserEngine)){
_DOMParamElement.value=objj_msgSend(_9,"filename");
_DOMInnerObjectElement.data=objj_msgSend(_9,"filename");
}else{
objj_msgSend(_7,"_rebuildIEObjects");
}
}
}),new objj_method(sel_getUid("flashMovie"),function(_a,_b){
with(_a){
return _flashMovie;
}
}),new objj_method(sel_getUid("setFlashVars:"),function(_c,_d,_e){
with(_c){
var _f="",_10=objj_msgSend(_e,"keyEnumerator");
var key;
while(key=objj_msgSend(_10,"nextObject")){
_f=objj_msgSend(_f,"stringByAppendingFormat:","&%@=%@",key,objj_msgSend(_e,"objectForKey:",key));
}
if(!_params){
_params=objj_msgSend(CPDictionary,"dictionary");
}
objj_msgSend(_params,"setObject:forKey:",_f,"flashvars");
objj_msgSend(_c,"setParameters:",_params);
}
}),new objj_method(sel_getUid("flashVars"),function(_11,_12){
with(_11){
return objj_msgSend(_params,"objectForKey:","flashvars");
}
}),new objj_method(sel_getUid("setParameters:"),function(_13,_14,_15){
with(_13){
if(_paramElements&&!CPBrowserIsEngine(CPInternetExplorerBrowserEngine)){
var _16=objj_msgSend(_paramElements,"allValues"),_17=objj_msgSend(_16,"count");
for(var i=0;i<_17;i++){
_DOMObjectElement.removeChild(objj_msgSend(_16,"objectAtIndex:",i));
}
}
_params=_15;
if(!CPBrowserIsEngine(CPInternetExplorerBrowserEngine)){
_paramElements=objj_msgSend(CPDictionary,"dictionary");
var _18=objj_msgSend(_params,"keyEnumerator"),key;
while(key=objj_msgSend(_18,"nextObject")&&_DOMObjectElement){
var _19=document.createElement("param");
_19.name=key;
_19.value=objj_msgSend(_params,"objectForKey:",key);
_DOMObjectElement.appendChild(_19);
objj_msgSend(_paramElements,"setObject:forKey:",_19,key);
}
}else{
objj_msgSend(_13,"_rebuildIEObjects");
}
}
}),new objj_method(sel_getUid("parameters"),function(_1a,_1b){
with(_1a){
return _params;
}
}),new objj_method(sel_getUid("_rebuildIEObjects"),function(_1c,_1d){
with(_1c){
_DOMElement.innerHTML="";
if(!objj_msgSend(_flashMovie,"filename")){
return;
}
var _1e=objj_msgSend(CPString,"stringWithFormat:","<param name='movie' value='%@' />",objj_msgSend(_flashMovie,"filename")),_1f=objj_msgSend(_params,"keyEnumerator"),key;
while(key=objj_msgSend(_1f,"nextObject")){
_1e=objj_msgSend(_1e,"stringByAppendingFormat:","<param name='%@' value='%@' />",key,objj_msgSend(_params,"objectForKey:",key));
}
_DOMObjectElement=document.createElement("object");
_DOMElement.appendChild(_DOMObjectElement);
_DOMObjectElement.outerHTML=objj_msgSend(CPString,"stringWithFormat:","<object classid=%@ width=%@ height=%@>%@</object>",_1,CGRectGetWidth(objj_msgSend(_1c,"bounds")),CGRectGetHeight(objj_msgSend(_1c,"bounds")),_1e);
}
}),new objj_method(sel_getUid("mouseDragged:"),function(_20,_21,_22){
with(_20){
objj_msgSend(objj_msgSend(objj_msgSend(_20,"window"),"platformWindow"),"_propagateCurrentDOMEvent:",YES);
}
}),new objj_method(sel_getUid("mouseDown:"),function(_23,_24,_25){
with(_23){
objj_msgSend(objj_msgSend(objj_msgSend(_23,"window"),"platformWindow"),"_propagateCurrentDOMEvent:",YES);
}
}),new objj_method(sel_getUid("mouseUp:"),function(_26,_27,_28){
with(_26){
objj_msgSend(objj_msgSend(objj_msgSend(_26,"window"),"platformWindow"),"_propagateCurrentDOMEvent:",YES);
}
})]);
p;8;CPFont.jt;3326;@STATIC;1.0;t;3307;
var _1={},_2="Arial, sans-serif",_3=new RegExp("\\s*,\\s*","g");
var _4=objj_allocateClassPair(CPObject,"CPFont"),_5=_4.isa;
class_addIvars(_4,[new objj_ivar("_name"),new objj_ivar("_size"),new objj_ivar("_isBold"),new objj_ivar("_cssString")]);
objj_registerClassPair(_4);
class_addMethods(_4,[new objj_method(sel_getUid("_initWithName:size:bold:"),function(_6,_7,_8,_9,_a){
with(_6){
_6=objj_msgSendSuper({receiver:_6,super_class:objj_getClass("CPFont").super_class},"init");
if(_6){
_name=_8;
_size=_9;
_isBold=_a;
_cssString=(_isBold?"bold ":"")+ROUND(_size)+"px "+((_name===_2)?_name:("\""+_name.replace(_3,"\", \"")+"\", "+_2));
_1[_cssString]=_6;
}
return _6;
}
}),new objj_method(sel_getUid("size"),function(_b,_c){
with(_b){
return _size;
}
}),new objj_method(sel_getUid("cssString"),function(_d,_e){
with(_d){
return _cssString;
}
}),new objj_method(sel_getUid("familyName"),function(_f,_10){
with(_f){
return _name;
}
}),new objj_method(sel_getUid("isEqual:"),function(_11,_12,_13){
with(_11){
return objj_msgSend(_13,"isKindOfClass:",objj_msgSend(CPFont,"class"))&&objj_msgSend(_13,"cssString")===objj_msgSend(_11,"cssString");
}
}),new objj_method(sel_getUid("description"),function(_14,_15){
with(_14){
return objj_msgSend(CPString,"stringWithFormat:","%@ %@ %f pt.",objj_msgSendSuper({receiver:_14,super_class:objj_getClass("CPFont").super_class},"description"),objj_msgSend(_14,"familyName"),objj_msgSend(_14,"size"));
}
})]);
class_addMethods(_5,[new objj_method(sel_getUid("fontWithName:size:"),function(_16,_17,_18,_19){
with(_16){
return _1[(NO?"bold ":"")+ROUND(_19)+"px "+((_18===_2)?_18:("\""+_18.replace(_3,"\", \"")+"\", "+_2))]||objj_msgSend(objj_msgSend(CPFont,"alloc"),"_initWithName:size:bold:",_18,_19,NO);
}
}),new objj_method(sel_getUid("boldFontWithName:size:"),function(_1a,_1b,_1c,_1d){
with(_1a){
return _1[(YES?"bold ":"")+ROUND(_1d)+"px "+((_1c===_2)?_1c:("\""+_1c.replace(_3,"\", \"")+"\", "+_2))]||objj_msgSend(objj_msgSend(CPFont,"alloc"),"_initWithName:size:bold:",_1c,_1d,YES);
}
}),new objj_method(sel_getUid("systemFontOfSize:"),function(_1e,_1f,_20){
with(_1e){
return _1[(NO?"bold ":"")+ROUND(_20)+"px "+((_2===_2)?_2:("\""+_2.replace(_3,"\", \"")+"\", "+_2))]||objj_msgSend(objj_msgSend(CPFont,"alloc"),"_initWithName:size:bold:",_2,_20,NO);
}
}),new objj_method(sel_getUid("boldSystemFontOfSize:"),function(_21,_22,_23){
with(_21){
return _1[(YES?"bold ":"")+ROUND(_23)+"px "+((_2===_2)?_2:("\""+_2.replace(_3,"\", \"")+"\", "+_2))]||objj_msgSend(objj_msgSend(CPFont,"alloc"),"_initWithName:size:bold:",_2,_23,YES);
}
})]);
var _24="CPFontNameKey",_25="CPFontSizeKey",_26="CPFontIsBoldKey";
var _4=objj_getClass("CPFont");
if(!_4){
throw new SyntaxError("*** Could not find definition for class \"CPFont\"");
}
var _5=_4.isa;
class_addMethods(_4,[new objj_method(sel_getUid("initWithCoder:"),function(_27,_28,_29){
with(_27){
return objj_msgSend(_27,"_initWithName:size:bold:",objj_msgSend(_29,"decodeObjectForKey:",_24),objj_msgSend(_29,"decodeFloatForKey:",_25),objj_msgSend(_29,"decodeBoolForKey:",_26));
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_2a,_2b,_2c){
with(_2a){
objj_msgSend(_2c,"encodeObject:forKey:",_name,_24);
objj_msgSend(_2c,"encodeFloat:forKey:",_size,_25);
objj_msgSend(_2c,"encodeBool:forKey:",_isBold,_26);
}
})]);
p;15;CPFontManager.jt;3322;@STATIC;1.0;I;21;Foundation/CPObject.jI;15;AppKit/CPFont.jt;3257;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("AppKit/CPFont.j",NO);
var _1=nil,_2=Nil;
var _3=objj_allocateClassPair(CPObject,"CPFontManager"),_4=_3.isa;
class_addIvars(_3,[new objj_ivar("_availableFonts")]);
objj_registerClassPair(_3);
class_addMethods(_3,[new objj_method(sel_getUid("availableFonts"),function(_5,_6){
with(_5){
if(!_availableFonts){
_7=document.createElement("span");
_7.fontSize="24px";
_7.appendChild(document.createTextNode("mmmmmmmmmml"));
var _8=document.createElement("div");
_8.style.position="absolute";
_8.style.top="-1000px";
_8.appendChild(_7);
document.getElementsByTagName("body")[0].appendChild(_8);
_9=_a(["monospace","serif","sans-serif","cursive"]);
_availableFonts=[];
for(var i=0;i<_b.length;i++){
var _c=_d(_b[i]);
if(_c){
_availableFonts.push(_b[i]);
}
}
}
return _availableFonts;
}
}),new objj_method(sel_getUid("fontWithNameIsAvailable:"),function(_e,_f,_10){
with(_e){
return _d(_10);
}
})]);
class_addMethods(_4,[new objj_method(sel_getUid("sharedFontManager"),function(_11,_12){
with(_11){
if(!_1){
_1=objj_msgSend(objj_msgSend(_2,"alloc"),"init");
}
return _1;
}
}),new objj_method(sel_getUid("setFontManagerFactory:"),function(_13,_14,_15){
with(_13){
_2=_15;
}
})]);
var _7,_9,_b=["American Typewriter","Apple Chancery","Arial","Arial Black","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Big Caslon","Bitstream Vera Sans","Bitstream Vera Sans Mono","Bitstream Vera Serif","Brush Script MT","Cambria","Caslon","Castellar","Cataneo BT","Centaur","Century Gothic","Century Schoolbook","Century Schoolbook L","Comic Sans","Comic Sans MS","Consolas","Constantia","Cooper Black","Copperplate","Copperplate Gothic Bold","Copperplate Gothic Light","Corbel","Courier","Courier New","Futura","Geneva","Georgia","Georgia Ref","Geeza Pro","Gigi","Gill Sans","Gill Sans MT","Gill Sans MT Condensed","Gill Sans MT Ext Condensed Bold","Gill Sans Ultra Bold","Gill Sans Ultra Bold Condensed","Helvetica","Helvetica Narrow","Helvetica Neue","Herculanum","High Tower Text","Highlight LET","Hoefler Text","Impact","Imprint MT Shadow","Lucida","Lucida Bright","Lucida Calligraphy","Lucida Console","Lucida Fax","Lucida Grande","Lucida Handwriting","Lucida Sans","Lucida Sans Typewriter","Lucida Sans Unicode","Marker Felt","Microsoft Sans Serif","Milano LET","Minion Web","MisterEarl BT","Mistral","Monaco","Monotype Corsiva","Monotype.com","New Century Schoolbook","New York","News Gothic MT","Papyrus","Tahoma","Techno","Tempus Sans ITC","Terminal","Textile","Times","Times New Roman","Tiranti Solid LET","Trebuchet MS","Verdana","Verdana Ref","Zapfino"];
var _d=function(_16){
for(var i=0;i<_9.length;i++){
if(_17(_9[i],_16)){
return true;
}
}
return false;
};
var _18={};
var _17=function(_19,_1a){
var a;
if(_18[_19]){
a=_18[_19];
}else{
_7.style.fontFamily="\""+_19+"\"";
_18[_19]=a={w:_7.offsetWidth,h:_7.offsetHeight};
}
_7.style.fontFamily="\""+_1a+"\", \""+_19+"\"";
var _1b=_7.offsetWidth;
var _1c=_7.offsetHeight;
return (a.w!=_1b||a.h!=_1c);
};
var _a=function(_1d){
for(var i=0;i<_1d.length;i++){
for(var j=0;j<i;j++){
if(_17(_1d[i],_1d[j])){
return [_1d[i],_1d[j]];
}
}
}
return [_1d[0]];
};
objj_msgSend(CPFontManager,"setFontManagerFactory:",objj_msgSend(CPFontManager,"class"));
p;12;CPGeometry.jt;4137;@STATIC;1.0;i;12;CGGeometry.jt;4101;
objj_executeFile("CGGeometry.j",YES);
CPMinXEdge=0;
CPMinYEdge=1;
CPMaxXEdge=2;
CPMaxYEdge=3;
CPMakePoint=CGPointMake;
CPMakeSize=CGSizeMake;
CPMakeRect=CGRectMake;
CPPointCreateCopy=function(_1){
return {x:_1.x,y:_1.y};
};
CPPointMake=function(x,y){
return {x:x,y:y};
};
CPRectInset=function(_2,dX,dY){
return CPRectMake(_2.origin.x+dX,_2.origin.y+dY,_2.size.width-2*dX,_2.size.height-2*dY);
};
CPRectIntegral=function(_3){
alert("CPRectIntegral unimplemented");
};
CPRectIntersection=function(_4,_5){
var _6=CPRectMake(Math.max(CPRectGetMinX(_4),CPRectGetMinX(_5)),Math.max(CPRectGetMinY(_4),CPRectGetMinY(_5)),0,0);
_6.size.width=Math.min(CPRectGetMaxX(_4),CPRectGetMaxX(_5))-CPRectGetMinX(_6);
_6.size.height=Math.min(CPRectGetMaxY(_4),CPRectGetMaxY(_5))-CPRectGetMinY(_6);
return CPRectIsEmpty(_6)?CPRectMakeZero():_6;
};
CPRectCreateCopy=function(_7){
return {origin:CPPointCreateCopy(_7.origin),size:CPSizeCreateCopy(_7.size)};
};
CPRectMake=function(x,y,_8,_9){
return {origin:CPPointMake(x,y),size:CPSizeMake(_8,_9)};
};
CPRectOffset=function(_a,dX,dY){
return CPRectMake(_a.origin.x+dX,_a.origin.y+dY,_a.size.width,_a.size.height);
};
CPRectStandardize=function(_b){
var _c=CPRectGetWidth(_b),_d=CPRectGetHeight(_b),_e=CPRectCreateCopy(_b);
if(_c<0){
_e.origin.x+=_c;
_e.size.width=-_c;
}
if(_d<0){
_e.origin.y+=_d;
_e.size.height=-_d;
}
return _e;
};
CPRectUnion=function(_f,_10){
var _11=Math.min(CPRectGetMinX(_f),CPRectGetMinX(_10)),_12=Math.min(CPRectGetMinY(_f),CPRectGetMinY(_10)),_13=Math.max(CPRectGetMaxX(_f),CPRectGetMaxX(_10)),_14=Math.max(CPRectGetMaxY(_f),CPRectGetMaxY(_10));
return CPRectMake(_11,_12,_13-_11,_14-_12);
};
CPSizeCreateCopy=function(_15){
return {width:_15.width,height:_15.height};
};
CPSizeMake=function(_16,_17){
return {width:_16,height:_17};
};
CPRectContainsPoint=function(_18,_19){
return _19.x>=CPRectGetMinX(_18)&&_19.y>=CPRectGetMinY(_18)&&_19.x<CPRectGetMaxX(_18)&&_19.y<CPRectGetMaxY(_18);
};
CPRectContainsRect=function(_1a,_1b){
return CGRectContainsRect(_1a,_1b);
};
CPPointEqualToPoint=function(_1c,_1d){
return _1c.x==_1d.x&&_1c.y==_1d.y;
};
CPRectEqualToRect=function(_1e,_1f){
return CPPointEqualToPoint(_1e.origin,_1f.origin)&&CPSizeEqualToSize(_1e.size,_1f.size);
};
CPRectGetHeight=function(_20){
return _20.size.height;
};
CPRectGetMaxX=function(_21){
return _21.origin.x+_21.size.width;
};
CPRectGetMaxY=function(_22){
return _22.origin.y+_22.size.height;
};
CPRectGetMidX=function(_23){
return _23.origin.x+(_23.size.width)/2;
};
CPRectGetMidY=function(_24){
return _24.origin.y+(_24.size.height)/2;
};
CPRectGetMinX=function(_25){
return _25.origin.x;
};
CPRectGetMinY=function(_26){
return _26.origin.y;
};
CPRectGetWidth=function(_27){
return _27.size.width;
};
CPRectIntersectsRect=function(_28,_29){
return !CPRectIsEmpty(CPRectIntersection(_28,_29));
};
CPRectIsEmpty=function(_2a){
return _2a.size.width<=0||_2a.size.height<=0;
};
CPRectIsNull=function(_2b){
return _2b.size.width<=0||_2b.size.height<=0;
};
CPSizeEqualToSize=function(_2c,_2d){
return _2c.width==_2d.width&&_2c.height==_2d.height;
};
CPStringFromPoint=function(_2e){
return "{"+_2e.x+", "+_2e.y+"}";
};
CPStringFromSize=function(_2f){
return "{"+_2f.width+", "+_2f.height+"}";
};
CPStringFromRect=function(_30){
return "{"+CPStringFromPoint(_30.origin)+", "+CPStringFromSize(_30.size)+"}";
};
CPPointFromString=function(_31){
var _32=_31.indexOf(",");
return {x:parseFloat(_31.substr(1,_32-1),10),y:parseFloat(_31.substring(_32+1,_31.length),10)};
};
CPSizeFromString=function(_33){
var _34=_33.indexOf(",");
return {width:parseFloat(_33.substr(1,_34-1),10),height:parseFloat(_33.substring(_34+1,_33.length),10)};
};
CPRectFromString=function(_35){
var _36=_35.indexOf(",",_35.indexOf(",")+1);
return {origin:CPPointFromString(_35.substr(1,_36-1)),size:CPSizeFromString(_35.substring(_36+2,_35.length))};
};
CPPointFromEvent=function(_37){
return CPPointMake(_37.clientX,_37.clientY,0);
};
CPSizeMakeZero=function(){
return CPSizeMake(0,0);
};
CPRectMakeZero=function(){
return CPRectMake(0,0,0,0);
};
CPPointMakeZero=function(){
return CPPointMake(0,0,0);
};
p;19;CPGraphicsContext.jt;922;@STATIC;1.0;t;904;
var _1=nil;
var _2=objj_allocateClassPair(CPObject,"CPGraphicsContext"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_graphicsPort")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("initWithGraphicsPort:"),function(_4,_5,_6){
with(_4){
_4=objj_msgSendSuper({receiver:_4,super_class:objj_getClass("CPGraphicsContext").super_class},"init");
if(_4){
_graphicsPort=_6;
}
return _4;
}
}),new objj_method(sel_getUid("graphicsPort"),function(_7,_8){
with(_7){
return _graphicsPort;
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("currentContext"),function(_9,_a){
with(_9){
return _1;
}
}),new objj_method(sel_getUid("setCurrentContext:"),function(_b,_c,_d){
with(_b){
_1=_d;
}
}),new objj_method(sel_getUid("graphicsContextWithGraphicsPort:flipped:"),function(_e,_f,_10,_11){
with(_e){
return objj_msgSend(objj_msgSend(_e,"alloc"),"initWithGraphicsPort:",_10);
}
})]);
p;9;CPImage.jt;9889;@STATIC;1.0;I;21;Foundation/CPBundle.jI;33;Foundation/CPNotificationCenter.jI;21;Foundation/CPObject.jI;22;Foundation/CPRunLoop.jI;21;Foundation/CPString.ji;12;CPGeometry.jt;9710;
objj_executeFile("Foundation/CPBundle.j",NO);
objj_executeFile("Foundation/CPNotificationCenter.j",NO);
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("Foundation/CPRunLoop.j",NO);
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("CPGeometry.j",YES);
CPImageLoadStatusInitialized=0;
CPImageLoadStatusLoading=1;
CPImageLoadStatusCompleted=2;
CPImageLoadStatusCancelled=3;
CPImageLoadStatusInvalidData=4;
CPImageLoadStatusUnexpectedEOF=5;
CPImageLoadStatusReadError=6;
CPImageDidLoadNotification="CPImageDidLoadNotification";
CPImageNameColorPanel="CPImageNameColorPanel";
CPImageNameColorPanelHighlighted="CPImageNameColorPanelHighlighted";
var _1={},_2={};
_2[CPImageNameColorPanel]=CGSizeMake(26,29);
_2[CPImageNameColorPanelHighlighted]=CGSizeMake(26,29);
CPImageInBundle=function(_3,_4,_5){
if(!_5){
_5=objj_msgSend(CPBundle,"mainBundle");
}
if(_4){
return objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_5,"pathForResource:",_3),_4);
}
return objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:",objj_msgSend(_5,"pathForResource:",_3));
};
CPAppKitImage=function(_6,_7){
return CPImageInBundle(_6,_7,objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(CPView,"class")));
};
var _8=objj_allocateClassPair(CPObject,"CPImage"),_9=_8.isa;
class_addIvars(_8,[new objj_ivar("_size"),new objj_ivar("_filename"),new objj_ivar("_name"),new objj_ivar("_delegate"),new objj_ivar("_loadStatus"),new objj_ivar("_image")]);
objj_registerClassPair(_8);
class_addMethods(_8,[new objj_method(sel_getUid("init"),function(_a,_b){
with(_a){
return objj_msgSend(_a,"initByReferencingFile:size:","",CGSizeMake(-1,-1));
}
}),new objj_method(sel_getUid("initByReferencingFile:size:"),function(_c,_d,_e,_f){
with(_c){
_c=objj_msgSendSuper({receiver:_c,super_class:objj_getClass("CPImage").super_class},"init");
if(_c){
_size=CPSizeCreateCopy(_f);
_filename=_e;
_loadStatus=CPImageLoadStatusInitialized;
}
return _c;
}
}),new objj_method(sel_getUid("initWithContentsOfFile:size:"),function(_10,_11,_12,_13){
with(_10){
_10=objj_msgSend(_10,"initByReferencingFile:size:",_12,_13);
if(_10){
objj_msgSend(_10,"load");
}
return _10;
}
}),new objj_method(sel_getUid("initWithContentsOfFile:"),function(_14,_15,_16){
with(_14){
_14=objj_msgSend(_14,"initByReferencingFile:size:",_16,CGSizeMake(-1,-1));
if(_14){
objj_msgSend(_14,"load");
}
return _14;
}
}),new objj_method(sel_getUid("filename"),function(_17,_18){
with(_17){
return _filename;
}
}),new objj_method(sel_getUid("setSize:"),function(_19,_1a,_1b){
with(_19){
_size=CGSizeMakeCopy(_1b);
}
}),new objj_method(sel_getUid("size"),function(_1c,_1d){
with(_1c){
return _size;
}
}),new objj_method(sel_getUid("setName:"),function(_1e,_1f,_20){
with(_1e){
if(_name===_20){
return;
}
if(_1[_20]===_1e){
_1[_20]=nil;
}
_name=_20;
_1[_20]=_1e;
}
}),new objj_method(sel_getUid("name"),function(_21,_22){
with(_21){
return _name;
}
}),new objj_method(sel_getUid("setDelegate:"),function(_23,_24,_25){
with(_23){
_delegate=_25;
}
}),new objj_method(sel_getUid("delegate"),function(_26,_27){
with(_26){
return _delegate;
}
}),new objj_method(sel_getUid("loadStatus"),function(_28,_29){
with(_28){
return _loadStatus;
}
}),new objj_method(sel_getUid("load"),function(_2a,_2b){
with(_2a){
if(_loadStatus==CPImageLoadStatusLoading||_loadStatus==CPImageLoadStatusCompleted){
return;
}
_loadStatus=CPImageLoadStatusLoading;
_image=new Image();
var _2c=YES;
_image.onload=function(){
if(_2c){
window.setTimeout(function(){
objj_msgSend(_2a,"_imageDidLoad");
},0);
}else{
objj_msgSend(_2a,"_imageDidLoad");
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
}
objj_msgSend(_2a,"_derefFromImage");
};
_image.onerror=function(){
if(_2c){
window.setTimeout(function(){
objj_msgSend(_2a,"_imageDidError");
},0);
}else{
objj_msgSend(_2a,"_imageDidError");
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
}
objj_msgSend(_2a,"_derefFromImage");
};
_image.onabort=function(){
if(_2c){
window.setTimeout(function(){
objj_msgSend(_2a,"_imageDidAbort");
},0);
}else{
objj_msgSend(_2a,"_imageDidAbort");
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
}
objj_msgSend(_2a,"_derefFromImage");
};
_image.src=_filename;
window.setTimeout(function(){
_2c=NO;
},0);
}
}),new objj_method(sel_getUid("isThreePartImage"),function(_2d,_2e){
with(_2d){
return NO;
}
}),new objj_method(sel_getUid("isNinePartImage"),function(_2f,_30){
with(_2f){
return NO;
}
}),new objj_method(sel_getUid("_derefFromImage"),function(_31,_32){
with(_31){
_image.onload=null;
_image.onerror=null;
_image.onabort=null;
}
}),new objj_method(sel_getUid("_imageDidLoad"),function(_33,_34){
with(_33){
_loadStatus=CPImageLoadStatusCompleted;
if(!_size||(_size.width==-1&&_size.height==-1)){
_size=CGSizeMake(_image.width,_image.height);
}
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPImageDidLoadNotification,_33);
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("imageDidLoad:"))){
objj_msgSend(_delegate,"imageDidLoad:",_33);
}
}
}),new objj_method(sel_getUid("_imageDidError"),function(_35,_36){
with(_35){
_loadStatus=CPImageLoadStatusReadError;
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("imageDidError:"))){
objj_msgSend(_delegate,"imageDidError:",_35);
}
}
}),new objj_method(sel_getUid("_imageDidAbort"),function(_37,_38){
with(_37){
_loadStatus=CPImageLoadStatusCancelled;
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("imageDidAbort:"))){
objj_msgSend(_delegate,"imageDidAbort:",_37);
}
}
})]);
class_addMethods(_9,[new objj_method(sel_getUid("imageNamed:"),function(_39,_3a,_3b){
with(_39){
var _3c=_1[_3b];
if(_3c){
return _3c;
}
var _3d=_2[_3b];
if(!_3d.isa){
_3d=CPAppKitImage("CPImage/"+_3b+".png",_3d);
objj_msgSend(_3d,"setName:",_3b);
_2[_3b]=_3d;
}
return _3d;
}
})]);
var _8=objj_getClass("CPImage");
if(!_8){
throw new SyntaxError("*** Could not find definition for class \"CPImage\"");
}
var _9=_8.isa;
class_addMethods(_8,[new objj_method(sel_getUid("initWithCoder:"),function(_3e,_3f,_40){
with(_3e){
return objj_msgSend(_3e,"initWithContentsOfFile:size:",objj_msgSend(_40,"decodeObjectForKey:","CPFilename"),objj_msgSend(_40,"decodeSizeForKey:","CPSize"));
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_41,_42,_43){
with(_41){
objj_msgSend(_43,"encodeObject:forKey:",_filename,"CPFilename");
objj_msgSend(_43,"encodeSize:forKey:",_size,"CPSize");
}
})]);
var _8=objj_allocateClassPair(CPObject,"CPThreePartImage"),_9=_8.isa;
class_addIvars(_8,[new objj_ivar("_imageSlices"),new objj_ivar("_isVertical")]);
objj_registerClassPair(_8);
class_addMethods(_8,[new objj_method(sel_getUid("initWithImageSlices:isVertical:"),function(_44,_45,_46,_47){
with(_44){
_44=objj_msgSendSuper({receiver:_44,super_class:objj_getClass("CPThreePartImage").super_class},"init");
if(_44){
_imageSlices=_46;
_isVertical=_47;
}
return _44;
}
}),new objj_method(sel_getUid("filename"),function(_48,_49){
with(_48){
return "";
}
}),new objj_method(sel_getUid("imageSlices"),function(_4a,_4b){
with(_4a){
return _imageSlices;
}
}),new objj_method(sel_getUid("isVertical"),function(_4c,_4d){
with(_4c){
return _isVertical;
}
}),new objj_method(sel_getUid("isThreePartImage"),function(_4e,_4f){
with(_4e){
return YES;
}
}),new objj_method(sel_getUid("isNinePartImage"),function(_50,_51){
with(_50){
return NO;
}
})]);
var _52="CPThreePartImageImageSlicesKey",_53="CPThreePartImageIsVerticalKey";
var _8=objj_getClass("CPThreePartImage");
if(!_8){
throw new SyntaxError("*** Could not find definition for class \"CPThreePartImage\"");
}
var _9=_8.isa;
class_addMethods(_8,[new objj_method(sel_getUid("initWithCoder:"),function(_54,_55,_56){
with(_54){
_54=objj_msgSendSuper({receiver:_54,super_class:objj_getClass("CPThreePartImage").super_class},"init");
if(_54){
_imageSlices=objj_msgSend(_56,"decodeObjectForKey:",_52);
_isVertical=objj_msgSend(_56,"decodeBoolForKey:",_53);
}
return _54;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_57,_58,_59){
with(_57){
objj_msgSend(_59,"encodeObject:forKey:",_imageSlices,_52);
objj_msgSend(_59,"encodeBool:forKey:",_isVertical,_53);
}
})]);
var _8=objj_allocateClassPair(CPObject,"CPNinePartImage"),_9=_8.isa;
class_addIvars(_8,[new objj_ivar("_imageSlices")]);
objj_registerClassPair(_8);
class_addMethods(_8,[new objj_method(sel_getUid("initWithImageSlices:"),function(_5a,_5b,_5c){
with(_5a){
_5a=objj_msgSendSuper({receiver:_5a,super_class:objj_getClass("CPNinePartImage").super_class},"init");
if(_5a){
_imageSlices=_5c;
}
return _5a;
}
}),new objj_method(sel_getUid("filename"),function(_5d,_5e){
with(_5d){
return "";
}
}),new objj_method(sel_getUid("imageSlices"),function(_5f,_60){
with(_5f){
return _imageSlices;
}
}),new objj_method(sel_getUid("isThreePartImage"),function(_61,_62){
with(_61){
return NO;
}
}),new objj_method(sel_getUid("isNinePartImage"),function(_63,_64){
with(_63){
return YES;
}
})]);
var _65="CPNinePartImageImageSlicesKey";
var _8=objj_getClass("CPNinePartImage");
if(!_8){
throw new SyntaxError("*** Could not find definition for class \"CPNinePartImage\"");
}
var _9=_8.isa;
class_addMethods(_8,[new objj_method(sel_getUid("initWithCoder:"),function(_66,_67,_68){
with(_66){
_66=objj_msgSendSuper({receiver:_66,super_class:objj_getClass("CPNinePartImage").super_class},"init");
if(_66){
_imageSlices=objj_msgSend(_68,"decodeObjectForKey:",_65);
}
return _66;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_69,_6a,_6b){
with(_69){
objj_msgSend(_6b,"encodeObject:forKey:",_imageSlices,_65);
}
})]);
p;13;CPImageView.jt;8400;@STATIC;1.0;I;33;Foundation/CPNotificationCenter.ji;11;CPControl.ji;9;CPImage.ji;14;CPShadowView.jt;8295;
objj_executeFile("Foundation/CPNotificationCenter.j",NO);
objj_executeFile("CPControl.j",YES);
objj_executeFile("CPImage.j",YES);
objj_executeFile("CPShadowView.j",YES);
CPScaleProportionally=0;
CPScaleToFit=1;
CPScaleNone=2;
var _1=nil;
var _2=3,_3=3,_4=3,_5=5,_6=_4+_5,_7=_2+_3;
var _8=objj_allocateClassPair(CPControl,"CPImageView"),_9=_8.isa;
class_addIvars(_8,[new objj_ivar("_DOMImageElement"),new objj_ivar("_hasShadow"),new objj_ivar("_shadowView"),new objj_ivar("_isEditable"),new objj_ivar("_imageRect")]);
objj_registerClassPair(_8);
class_addMethods(_8,[new objj_method(sel_getUid("initWithFrame:"),function(_a,_b,_c){
with(_a){
_a=objj_msgSendSuper({receiver:_a,super_class:objj_getClass("CPImageView").super_class},"initWithFrame:",_c);
if(_a){
_DOMImageElement=document.createElement("img");
_DOMImageElement.style.position="absolute";
_DOMImageElement.style.left="0px";
_DOMImageElement.style.top="0px";
if(objj_msgSend(CPPlatform,"supportsDragAndDrop")){
_DOMImageElement.setAttribute("draggable","true");
_DOMImageElement.style["-khtml-user-drag"]="element";
}
_DOMElement.appendChild(_DOMImageElement);
_DOMImageElement.style.visibility="hidden";
}
return _a;
}
}),new objj_method(sel_getUid("image"),function(_d,_e){
with(_d){
return objj_msgSend(_d,"objectValue");
}
}),new objj_method(sel_getUid("setImage:"),function(_f,_10,_11){
with(_f){
objj_msgSend(_f,"setObjectValue:",_11);
}
}),new objj_method(sel_getUid("setObjectValue:"),function(_12,_13,_14){
with(_12){
var _15=objj_msgSend(_12,"objectValue");
if(_15===_14){
return;
}
objj_msgSendSuper({receiver:_12,super_class:objj_getClass("CPImageView").super_class},"setObjectValue:",_14);
var _16=objj_msgSend(CPNotificationCenter,"defaultCenter");
if(_15){
objj_msgSend(_16,"removeObserver:name:object:",_12,CPImageDidLoadNotification,_15);
}
var _17=objj_msgSend(_12,"objectValue");
_DOMImageElement.src=_17?objj_msgSend(_17,"filename"):"";
var _18=objj_msgSend(_17,"size");
if(_18&&_18.width===-1&&_18.height===-1){
objj_msgSend(_16,"addObserver:selector:name:object:",_12,sel_getUid("imageDidLoad:"),CPImageDidLoadNotification,_17);
_DOMImageElement.width=0;
_DOMImageElement.height=0;
objj_msgSend(_shadowView,"setHidden:",YES);
}else{
objj_msgSend(_12,"hideOrDisplayContents");
objj_msgSend(_12,"setNeedsLayout");
objj_msgSend(_12,"setNeedsDisplay:",YES);
}
}
}),new objj_method(sel_getUid("imageDidLoad:"),function(_19,_1a,_1b){
with(_19){
objj_msgSend(_19,"hideOrDisplayContents");
objj_msgSend(_19,"setNeedsLayout");
objj_msgSend(_19,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("hasShadow"),function(_1c,_1d){
with(_1c){
return _hasShadow;
}
}),new objj_method(sel_getUid("setHasShadow:"),function(_1e,_1f,_20){
with(_1e){
if(_hasShadow==_20){
return;
}
_hasShadow=_20;
if(_hasShadow){
_shadowView=objj_msgSend(objj_msgSend(CPShadowView,"alloc"),"initWithFrame:",objj_msgSend(_1e,"bounds"));
objj_msgSend(_1e,"addSubview:",_shadowView);
objj_msgSend(_1e,"setNeedsLayout");
objj_msgSend(_1e,"setNeedsDisplay:",YES);
}else{
objj_msgSend(_shadowView,"removeFromSuperview");
_shadowView=nil;
}
objj_msgSend(_1e,"hideOrDisplayContents");
}
}),new objj_method(sel_getUid("setImageScaling:"),function(_21,_22,_23){
with(_21){
objj_msgSendSuper({receiver:_21,super_class:objj_getClass("CPImageView").super_class},"setImageScaling:",_23);
if(objj_msgSend(_21,"currentValueForThemeAttribute:","image-scaling")===CPScaleToFit){
if(NULL){
var _24=_CGPointApplyAffineTransform(CGPointMake(0,0),NULL);
}else{
var _24={x:0,y:0};
}
_DOMImageElement.style.left=ROUND(_24.x)+"px";
_DOMImageElement.style.top=ROUND(_24.y)+"px";
}
objj_msgSend(_21,"setNeedsLayout");
objj_msgSend(_21,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("imageScaling"),function(_25,_26){
with(_25){
return objj_msgSend(_25,"currentValueForThemeAttribute:","image-scaling");
}
}),new objj_method(sel_getUid("hideOrDisplayContents"),function(_27,_28){
with(_27){
if(!objj_msgSend(_27,"image")){
_DOMImageElement.style.visibility="hidden";
objj_msgSend(_shadowView,"setHidden:",YES);
}else{
_DOMImageElement.style.visibility="visible";
objj_msgSend(_shadowView,"setHidden:",NO);
}
}
}),new objj_method(sel_getUid("imageRect"),function(_29,_2a){
with(_29){
return _imageRect;
}
}),new objj_method(sel_getUid("layoutSubviews"),function(_2b,_2c){
with(_2b){
if(!objj_msgSend(_2b,"image")){
return;
}
var _2d=objj_msgSend(_2b,"bounds"),_2e=objj_msgSend(_2b,"image"),_2f=objj_msgSend(_2b,"currentValueForThemeAttribute:","image-scaling"),x=0,y=0,_30=(_hasShadow?_7:0),_31=(_hasShadow?_6:0),_32=(_2d.size.width),_33=(_2d.size.height),_34=_32-_30,_35=_33-_31;
if(_2f===CPScaleToFit){
_DOMImageElement.width=ROUND(_34);
_DOMImageElement.height=ROUND(_35);
}else{
var _36=objj_msgSend(_2e,"size");
if(_36.width==-1&&_36.height==-1){
return;
}
if(_2f===CPScaleProportionally){
if(_34>=_36.width&&_35>=_36.height){
_34=_36.width;
_35=_36.height;
}else{
var _37=_36.width/_36.height,_38=_34/_35;
if(_38>_37){
_34=_35*_37;
}else{
_35=_34/_37;
}
}
_DOMImageElement.width=ROUND(_34);
_DOMImageElement.height=ROUND(_35);
}else{
_34=_36.width;
_35=_36.height;
}
if(_2f==CPScaleNone){
_DOMImageElement.width=ROUND(_36.width);
_DOMImageElement.height=ROUND(_36.height);
}
var x=(_32-_34)/2,y=(_33-_35)/2;
if(NULL){
var _39=_CGPointApplyAffineTransform(CGPointMake(x,y),NULL);
}else{
var _39={x:x,y:y};
}
_DOMImageElement.style.left=ROUND(_39.x)+"px";
_DOMImageElement.style.top=ROUND(_39.y)+"px";
}
_imageRect={origin:{x:x,y:y},size:{width:_34,height:_35}};
if(_hasShadow){
objj_msgSend(_shadowView,"setFrame:",{origin:{x:x-_2,y:y-_4},size:{width:_34+_30,height:_35+_31}});
}
}
}),new objj_method(sel_getUid("mouseDown:"),function(_3a,_3b,_3c){
with(_3a){
objj_msgSend(objj_msgSend(_3a,"nextResponder"),"mouseDown:",_3c);
}
}),new objj_method(sel_getUid("setEditable:"),function(_3d,_3e,_3f){
with(_3d){
if(_isEditable===_3f){
return;
}
_isEditable=_3f;
if(_isEditable){
objj_msgSend(_3d,"registerForDraggedTypes:",[CPImagesPboardType]);
}else{
var _40=objj_msgSend(_3d,"registeredDraggedTypes");
objj_msgSend(_3d,"unregisterDraggedTypes");
objj_msgSend(_40,"removeObjectIdenticalTo:",CPImagesPboardType);
objj_msgSend(_3d,"registerForDraggedTypes:",_40);
}
}
}),new objj_method(sel_getUid("isEditable"),function(_41,_42){
with(_41){
return _isEditable;
}
}),new objj_method(sel_getUid("performDragOperation:"),function(_43,_44,_45){
with(_43){
var _46=objj_msgSend(CPKeyedUnarchiver,"unarchiveObjectWithData:",objj_msgSend(objj_msgSend(_45,"draggingPasteboard"),"dataForType:",CPImagesPboardType));
if(objj_msgSend(_46,"count")){
objj_msgSend(_43,"setImage:",_46[0]);
}
}
})]);
var _47="CPImageViewImageKey",_48="CPImageViewImageScalingKey",_49="CPImageViewHasShadowKey",_4a="CPImageViewIsEditableKey";
var _8=objj_getClass("CPImageView");
if(!_8){
throw new SyntaxError("*** Could not find definition for class \"CPImageView\"");
}
var _9=_8.isa;
class_addMethods(_8,[new objj_method(sel_getUid("initWithCoder:"),function(_4b,_4c,_4d){
with(_4b){
_DOMImageElement=document.createElement("img");
_DOMImageElement.style.position="absolute";
_DOMImageElement.style.left="0px";
_DOMImageElement.style.top="0px";
_DOMImageElement.style.visibility="hidden";
if(objj_msgSend(CPPlatform,"supportsDragAndDrop")){
_DOMImageElement.setAttribute("draggable","true");
_DOMImageElement.style["-khtml-user-drag"]="element";
}
_4b=objj_msgSendSuper({receiver:_4b,super_class:objj_getClass("CPImageView").super_class},"initWithCoder:",_4d);
if(_4b){
_DOMElement.appendChild(_DOMImageElement);
objj_msgSend(_4b,"setHasShadow:",objj_msgSend(_4d,"decodeBoolForKey:",_49));
if(objj_msgSend(_4d,"decodeBoolForKey:",_4a)||NO){
objj_msgSend(_4b,"setEditable:",YES);
}
objj_msgSend(_4b,"setNeedsLayout");
objj_msgSend(_4b,"setNeedsDisplay:",YES);
}
return _4b;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_4e,_4f,_50){
with(_4e){
if(_shadowView){
var _51=_subviews;
_subviews=objj_msgSend(_subviews,"copy");
objj_msgSend(_subviews,"removeObjectIdenticalTo:",_shadowView);
}
objj_msgSendSuper({receiver:_4e,super_class:objj_getClass("CPImageView").super_class},"encodeWithCoder:",_50);
if(_shadowView){
_subviews=_51;
}
objj_msgSend(_50,"encodeBool:forKey:",_hasShadow,_49);
if(_isEditable){
objj_msgSend(_50,"encodeBool:forKey:",_isEditable,_4a);
}
}
})]);
p;13;CPOpenPanel.jt;2079;@STATIC;1.0;I;16;AppKit/CPPanel.jt;2039;
objj_executeFile("AppKit/CPPanel.j",NO);
var _1=objj_allocateClassPair(CPPanel,"CPOpenPanel"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_canChooseFiles"),new objj_ivar("_canChooseDirectories"),new objj_ivar("_allowsMultipleSelection"),new objj_ivar("_directoryURL"),new objj_ivar("_URLs")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("canChooseFiles"),function(_3,_4){
with(_3){
return _canChooseFiles;
}
}),new objj_method(sel_getUid("setCanChooseFiles:"),function(_5,_6,_7){
with(_5){
_canChooseFiles=_7;
}
}),new objj_method(sel_getUid("canChooseDirectories"),function(_8,_9){
with(_8){
return _canChooseDirectories;
}
}),new objj_method(sel_getUid("setCanChooseDirectories:"),function(_a,_b,_c){
with(_a){
_canChooseDirectories=_c;
}
}),new objj_method(sel_getUid("allowsMultipleSelection"),function(_d,_e){
with(_d){
return _allowsMultipleSelection;
}
}),new objj_method(sel_getUid("setAllowsMultipleSelection:"),function(_f,_10,_11){
with(_f){
_allowsMultipleSelection=_11;
}
}),new objj_method(sel_getUid("directoryURL"),function(_12,_13){
with(_12){
return _directoryURL;
}
}),new objj_method(sel_getUid("setDirectoryURL:"),function(_14,_15,_16){
with(_14){
_directoryURL=_16;
}
}),new objj_method(sel_getUid("runModal"),function(_17,_18){
with(_17){
if(typeof window["cpOpenPanel"]==="function"){
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
var _19={directoryURL:objj_msgSend(_17,"directoryURL"),canChooseFiles:objj_msgSend(_17,"canChooseFiles"),canChooseDirectories:objj_msgSend(_17,"canChooseDirectories"),allowsMultipleSelection:objj_msgSend(_17,"allowsMultipleSelection")};
var _1a=window.cpOpenPanel(_19);
_URLs=_1a.URLs;
return _1a.button;
}
throw "-runModal is unimplemented.";
}
}),new objj_method(sel_getUid("URLs"),function(_1b,_1c){
with(_1b){
return _URLs;
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("openPanel"),function(_1d,_1e){
with(_1d){
return objj_msgSend(objj_msgSend(CPOpenPanel,"alloc"),"init");
}
})]);
p;15;CPOutlineView.jt;29630;@STATIC;1.0;i;15;CPTableColumn.ji;13;CPTableView.jt;29572;
objj_executeFile("CPTableColumn.j",YES);
objj_executeFile("CPTableView.j",YES);
CPOutlineViewColumnDidMoveNotification="CPOutlineViewColumnDidMoveNotification";
CPOutlineViewColumnDidResizeNotification="CPOutlineViewColumnDidResizeNotification";
CPOutlineViewItemDidCollapseNotification="CPOutlineViewItemDidCollapseNotification";
CPOutlineViewItemDidExpandNotification="CPOutlineViewItemDidExpandNotification";
CPOutlineViewItemWillCollapseNotification="CPOutlineViewItemWillCollapseNotification";
CPOutlineViewItemWillExpandNotification="CPOutlineViewItemWillExpandNotification";
CPOutlineViewSelectionDidChangeNotification="CPOutlineViewSelectionDidChangeNotification";
CPOutlineViewSelectionIsChangingNotification="CPOutlineViewSelectionIsChangingNotification";
var _1=1<<1,_2=1<<2,_3=1<<3,_4=1<<4,_5=1<<5,_6=1<<6,_7=1<<7,_8=1<<8,_9=1<<9,_a=1<<10;
var _b=1<<1,_c=1<<2,_d=1<<3,_e=1<<4,_f=1<<5;
CPOutlineViewDropOnItemIndex=-1;
var _10=objj_allocateClassPair(CPTableView,"CPOutlineView"),_11=_10.isa;
class_addIvars(_10,[new objj_ivar("_outlineViewDataSource"),new objj_ivar("_outlineViewDelegate"),new objj_ivar("_outlineTableColumn"),new objj_ivar("_indentationPerLevel"),new objj_ivar("_indentationMarkerFollowsDataView"),new objj_ivar("_implementedOutlineViewDataSourceMethods"),new objj_ivar("_implementedOutlineViewDelegateMethods"),new objj_ivar("_rootItemInfo"),new objj_ivar("_itemsForRows"),new objj_ivar("_itemInfosForItems"),new objj_ivar("_disclosureControlPrototype"),new objj_ivar("_disclosureControlsForRows"),new objj_ivar("_disclosureControlData"),new objj_ivar("_disclosureControlQueue"),new objj_ivar("_shouldRetargetItem"),new objj_ivar("_retargetedItem"),new objj_ivar("_shouldRetargetChildIndex"),new objj_ivar("_retargedChildIndex")]);
objj_registerClassPair(_10);
class_addMethods(_10,[new objj_method(sel_getUid("initWithFrame:"),function(_12,_13,_14){
with(_12){
_12=objj_msgSendSuper({receiver:_12,super_class:objj_getClass("CPOutlineView").super_class},"initWithFrame:",_14);
if(_12){
_selectionHighlightStyle=CPTableViewSelectionHighlightStyleSourceList;
_rootItemInfo={isExpanded:YES,isExpandable:NO,level:-1,row:-1,children:[],weight:0};
_itemsForRows=[];
_itemInfosForItems={};
_disclosureControlsForRows=[];
_retargetedItem=nil;
_shouldRetargetItem=NO;
_retargedChildIndex=nil;
_shouldRetargetChildIndex=NO;
objj_msgSend(_12,"setIndentationPerLevel:",16);
objj_msgSend(_12,"setIndentationMarkerFollowsDataView:",YES);
objj_msgSendSuper({receiver:_12,super_class:objj_getClass("CPOutlineView").super_class},"setDataSource:",objj_msgSend(objj_msgSend(_CPOutlineViewTableViewDataSource,"alloc"),"initWithOutlineView:",_12));
objj_msgSendSuper({receiver:_12,super_class:objj_getClass("CPOutlineView").super_class},"setDelegate:",objj_msgSend(objj_msgSend(_CPOutlineViewTableViewDelegate,"alloc"),"initWithOutlineView:",_12));
objj_msgSend(_12,"setDisclosureControlPrototype:",objj_msgSend(objj_msgSend(CPDisclosureButton,"alloc"),"initWithFrame:",CGRectMake(0,0,10,10)));
}
return _12;
}
}),new objj_method(sel_getUid("setDataSource:"),function(_15,_16,_17){
with(_15){
if(_outlineViewDataSource===_17){
return;
}
if(!objj_msgSend(_17,"respondsToSelector:",sel_getUid("outlineView:child:ofItem:"))){
objj_msgSend(CPException,"raise:reason:",CPInternalInconsistencyException,"Data source must implement 'outlineView:child:ofItem:'");
}
if(!objj_msgSend(_17,"respondsToSelector:",sel_getUid("outlineView:isItemExpandable:"))){
objj_msgSend(CPException,"raise:reason:",CPInternalInconsistencyException,"Data source must implement 'outlineView:isItemExpandable:'");
}
if(!objj_msgSend(_17,"respondsToSelector:",sel_getUid("outlineView:numberOfChildrenOfItem:"))){
objj_msgSend(CPException,"raise:reason:",CPInternalInconsistencyException,"Data source must implement 'outlineView:numberOfChildrenOfItem:'");
}
if(!objj_msgSend(_17,"respondsToSelector:",sel_getUid("outlineView:objectValueForTableColumn:byItem:"))){
objj_msgSend(CPException,"raise:reason:",CPInternalInconsistencyException,"Data source must implement 'outlineView:objectValueForTableColumn:byItem:'");
}
_outlineViewDataSource=_17;
_implementedOutlineViewDataSourceMethods=0;
if(objj_msgSend(_outlineViewDataSource,"respondsToSelector:",sel_getUid("outlineView:setObjectValue:forTableColumn:byItem:"))){
_implementedOutlineViewDataSourceMethods|=_1;
}
if(objj_msgSend(_outlineViewDataSource,"respondsToSelector:",sel_getUid("outlineView:shouldDeferDisplayingChildrenOfItem:"))){
_implementedOutlineViewDataSourceMethods|=_2;
}
if(objj_msgSend(_outlineViewDataSource,"respondsToSelector:",sel_getUid("outlineView:acceptDrop:item:childIndex:"))){
_implementedOutlineViewDataSourceMethods|=_3;
}
if(objj_msgSend(_outlineViewDataSource,"respondsToSelector:",sel_getUid("outlineView:validateDrop:proposedItem:proposedChildIndex:"))){
_implementedOutlineViewDataSourceMethods|=_4;
}
if(objj_msgSend(_outlineViewDataSource,"respondsToSelector:",sel_getUid("outlineView:validateDrop:proposedRow:proposedDropOperation:"))){
_implementedOutlineViewDataSourceMethods|=_5;
}
if(objj_msgSend(_outlineViewDataSource,"respondsToSelector:",sel_getUid("outlineView:namesOfPromisedFilesDroppedAtDestination:forDraggedItems:"))){
_implementedOutlineViewDataSourceMethods|=_6;
}
if(objj_msgSend(_outlineViewDataSource,"respondsToSelector:",sel_getUid("outlineView:itemForPersistentObject:"))){
_implementedOutlineViewDataSourceMethods|=_7;
}
if(objj_msgSend(_outlineViewDataSource,"respondsToSelector:",sel_getUid("outlineView:persistentObjectForItem:"))){
_implementedOutlineViewDataSourceMethods|=_8;
}
if(objj_msgSend(_outlineViewDataSource,"respondsToSelector:",sel_getUid("outlineView:writeItems:toPasteboard:"))){
_implementedOutlineViewDataSourceMethods|=_9;
}
if(objj_msgSend(_outlineViewDataSource,"respondsToSelector:",sel_getUid("outlineView:sortDescriptorsDidChange:"))){
_implementedOutlineViewDataSourceMethods|=_a;
}
objj_msgSend(_15,"reloadData");
}
}),new objj_method(sel_getUid("dataSource"),function(_18,_19){
with(_18){
return _outlineViewDataSource;
}
}),new objj_method(sel_getUid("isExpandable:"),function(_1a,_1b,_1c){
with(_1a){
if(!_1c){
return YES;
}
var _1d=_itemInfosForItems[objj_msgSend(_1c,"UID")];
if(!_1d){
return NO;
}
return _1d.isExpandable;
}
}),new objj_method(sel_getUid("isItemExpanded:"),function(_1e,_1f,_20){
with(_1e){
if(!_20){
return YES;
}
var _21=_itemInfosForItems[objj_msgSend(_20,"UID")];
if(!_21){
return NO;
}
return _21.isExpanded;
}
}),new objj_method(sel_getUid("expandItem:"),function(_22,_23,_24){
with(_22){
objj_msgSend(_22,"expandItem:expandChildren:",_24,NO);
}
}),new objj_method(sel_getUid("expandItem:expandChildren:"),function(_25,_26,_27,_28){
with(_25){
var _29=null;
if(!_27){
_29=_rootItemInfo;
}else{
_29=_itemInfosForItems[objj_msgSend(_27,"UID")];
}
if(!_29){
return;
}
_29.isExpanded=YES;
objj_msgSend(_25,"reloadItem:reloadChildren:",_27,YES);
if(_28){
var _2a=_29.children,_2b=_2a.length;
while(_2b--){
objj_msgSend(_25,"expandItem:expandChildren:",_2a[_2b],YES);
}
}
}
}),new objj_method(sel_getUid("collapseItem:"),function(_2c,_2d,_2e){
with(_2c){
if(!_2e){
return;
}
var _2f=_itemInfosForItems[objj_msgSend(_2e,"UID")];
if(!_2f){
return;
}
if(!_2f.isExpanded){
return;
}
_2f.isExpanded=NO;
objj_msgSend(_2c,"reloadItem:reloadChildren:",_2e,YES);
}
}),new objj_method(sel_getUid("reloadItem:"),function(_30,_31,_32){
with(_30){
objj_msgSend(_30,"reloadItem:reloadChildren:",_32,NO);
}
}),new objj_method(sel_getUid("reloadItem:reloadChildren:"),function(_33,_34,_35,_36){
with(_33){
if(!!_36||!_35){
_37(_33,_35);
}else{
_38(_33,_35);
}
objj_msgSendSuper({receiver:_33,super_class:objj_getClass("CPOutlineView").super_class},"reloadData");
}
}),new objj_method(sel_getUid("itemAtRow:"),function(_39,_3a,_3b){
with(_39){
return _itemsForRows[_3b]||nil;
}
}),new objj_method(sel_getUid("rowForItem:"),function(_3c,_3d,_3e){
with(_3c){
if(!_3e){
return _rootItemInfo.row;
}
var _3f=_itemInfosForItems[objj_msgSend(_3e,"UID")];
if(!_3f){
return CPNotFound;
}
return _3f.row;
}
}),new objj_method(sel_getUid("setOutlineTableColumn:"),function(_40,_41,_42){
with(_40){
if(_outlineTableColumn===_42){
return;
}
_outlineTableColumn=_42;
objj_msgSend(_40,"reloadData");
}
}),new objj_method(sel_getUid("outlineTableColumn"),function(_43,_44){
with(_43){
return _outlineTableColumn;
}
}),new objj_method(sel_getUid("levelForItem:"),function(_45,_46,_47){
with(_45){
if(!_47){
return _rootItemInfo.level;
}
var _48=_itemInfosForItems[objj_msgSend(_47,"UID")];
if(!_48){
return CPNotFound;
}
return _48.level;
}
}),new objj_method(sel_getUid("levelForRow:"),function(_49,_4a,_4b){
with(_49){
return objj_msgSend(_49,"levelForItem:",objj_msgSend(_49,"itemAtRow:",_4b));
}
}),new objj_method(sel_getUid("setIndentationPerLevel:"),function(_4c,_4d,_4e){
with(_4c){
if(_indentationPerLevel===_4e){
return;
}
_indentationPerLevel=_4e;
objj_msgSend(_4c,"reloadData");
}
}),new objj_method(sel_getUid("indentationPerLevel"),function(_4f,_50){
with(_4f){
return _indentationPerLevel;
}
}),new objj_method(sel_getUid("setIndentationMarkerFollowsDataView:"),function(_51,_52,_53){
with(_51){
if(_indentationMarkerFollowsDataView===_53){
return;
}
_indentationMarkerFollowsDataView=_53;
objj_msgSend(_51,"reloadData");
}
}),new objj_method(sel_getUid("indentationMarkerFollowsDataView"),function(_54,_55){
with(_54){
return _indentationMarkerFollowsDataView;
}
}),new objj_method(sel_getUid("parentForItem:"),function(_56,_57,_58){
with(_56){
if(!_58){
return nil;
}
var _59=_itemInfosForItems[objj_msgSend(_58,"UID")];
if(!_59){
return nil;
}
var _5a=_59.parent;
if(_59[objj_msgSend(_5a,"UID")]===_rootItemInfo){
_5a=nil;
}
return _5a;
}
}),new objj_method(sel_getUid("frameOfOutlineDataViewAtColumn:row:"),function(_5b,_5c,_5d,_5e){
with(_5b){
var _5f=objj_msgSendSuper({receiver:_5b,super_class:objj_getClass("CPOutlineView").super_class},"frameOfDataViewAtColumn:row:",_5d,_5e),_60=(objj_msgSend(_5b,"levelForRow:",_5e)+1)*objj_msgSend(_5b,"indentationPerLevel");
_5f.origin.x+=_60;
_5f.size.width-=_60;
return _5f;
}
}),new objj_method(sel_getUid("selectRowIndexes:byExtendingSelection:"),function(_61,_62,_63,_64){
with(_61){
var _65=[];
objj_msgSend(objj_msgSend(_61,"selectedRowIndexes"),"getIndexes:maxCount:inIndexRange:",_65,-1,nil);
var _66=objj_msgSend(_65,"count");
while(_66--){
var _67=_65[_66],_68=objj_msgSend(_61,"itemAtRow:",_67);
if(!objj_msgSend(_61,"isExpandable:",_68)){
continue;
}
var _69=_disclosureControlsForRows[_67];
objj_msgSend(_69,"setHighlighted:",NO);
}
objj_msgSendSuper({receiver:_61,super_class:objj_getClass("CPOutlineView").super_class},"selectRowIndexes:byExtendingSelection:",_63,_64);
var _6a=[];
objj_msgSend(_63,"getIndexes:maxCount:inIndexRange:",_6a,-1,nil);
var _66=objj_msgSend(_6a,"count");
while(_66--){
var _67=_6a[_66],_68=objj_msgSend(_61,"itemAtRow:",_67);
if(!objj_msgSend(_61,"isExpandable:",_68)){
continue;
}
var _69=_disclosureControlsForRows[_67];
objj_msgSend(_69,"setHighlighted:",YES);
}
}
}),new objj_method(sel_getUid("setDelegate:"),function(_6b,_6c,_6d){
with(_6b){
if(_outlineViewDelegate===_6d){
return;
}
var _6e=objj_msgSend(CPNotificationCenter,"defaultCenter");
if(_outlineViewDelegate){
if(objj_msgSend(_outlineViewDelegate,"respondsToSelector:",sel_getUid("outlineViewColumnDidMove:"))){
objj_msgSend(_6e,"removeObserver:name:object:",_outlineViewDelegate,CPOutlineViewColumnDidMoveNotification,_6b);
}
if(objj_msgSend(_outlineViewDelegate,"respondsToSelector:",sel_getUid("outlineViewColumnDidResize:"))){
objj_msgSend(_6e,"removeObserver:name:object:",_outlineViewDelegate,CPOutlineViewColumnDidResizeNotification,_6b);
}
if(objj_msgSend(_outlineViewDelegate,"respondsToSelector:",sel_getUid("outlineViewSelectionDidChange:"))){
objj_msgSend(_6e,"removeObserver:name:object:",_outlineViewDelegate,CPOutlineViewSelectionDidChangeNotification,_6b);
}
if(objj_msgSend(_outlineViewDelegate,"respondsToSelector:",sel_getUid("outlineViewSelectionIsChanging:"))){
objj_msgSend(_6e,"removeObserver:name:object:",_outlineViewDelegate,CPOutlineViewSelectionIsChangingNotification,_6b);
}
}
_outlineViewDelegate=_6d;
_implementedOutlineViewDelegateMethods=0;
if(objj_msgSend(_outlineViewDelegate,"respondsToSelector:",sel_getUid("outlineView:dataViewForTableColumn:item:"))){
_implementedOutlineViewDelegateMethods|=_b;
}
if(objj_msgSend(_outlineViewDelegate,"respondsToSelector:",sel_getUid("outlineView:shouldSelectItem:"))){
_implementedOutlineViewDelegateMethods|=_c;
}
if(objj_msgSend(_outlineViewDelegate,"respondsToSelector:",sel_getUid("outlineView:heightOfRowByItem:"))){
_implementedOutlineViewDelegateMethods|=_d;
}
if(objj_msgSend(_outlineViewDelegate,"respondsToSelector:",sel_getUid("outlineView:willDisplayView:forTableColumn:item:"))){
_implementedOutlineViewDelegateMethods|=_e;
}
if(objj_msgSend(_outlineViewDelegate,"respondsToSelector:",sel_getUid("outlineView:isGroupItem:"))){
_implementedOutlineViewDelegateMethods|=_f;
}
if(objj_msgSend(_outlineViewDelegate,"respondsToSelector:",sel_getUid("outlineViewColumnDidMove:"))){
objj_msgSend(_6e,"addObserver:selector:name:object:",_outlineViewDelegate,sel_getUid("outlineViewColumnDidMove:"),CPOutlineViewColumnDidMoveNotification,_6b);
}
if(objj_msgSend(_outlineViewDelegate,"respondsToSelector:",sel_getUid("outlineViewColumnDidResize:"))){
objj_msgSend(_6e,"addObserver:selector:name:object:",_outlineViewDelegate,sel_getUid("outlineViewColumnDidMove:"),CPOutlineViewColumnDidResizeNotification,_6b);
}
if(objj_msgSend(_outlineViewDelegate,"respondsToSelector:",sel_getUid("outlineViewSelectionDidChange:"))){
objj_msgSend(_6e,"addObserver:selector:name:object:",_outlineViewDelegate,sel_getUid("outlineViewSelectionDidChange:"),CPOutlineViewSelectionDidChangeNotification,_6b);
}
if(objj_msgSend(_outlineViewDelegate,"respondsToSelector:",sel_getUid("outlineViewSelectionIsChanging:"))){
objj_msgSend(_6e,"addObserver:selector:name:object:",_outlineViewDelegate,sel_getUid("outlineViewSelectionIsChanging:"),CPOutlineViewSelectionIsChangingNotification,_6b);
}
}
}),new objj_method(sel_getUid("delegate"),function(_6f,_70){
with(_6f){
return _outlineViewDelegate;
}
}),new objj_method(sel_getUid("setDisclosureControlPrototype:"),function(_71,_72,_73){
with(_71){
_disclosureControlPrototype=_73;
_disclosureControlData=nil;
_disclosureControlQueue=[];
objj_msgSend(_71,"reloadData");
}
}),new objj_method(sel_getUid("reloadData"),function(_74,_75){
with(_74){
objj_msgSend(_74,"reloadItem:reloadChildren:",nil,YES);
}
}),new objj_method(sel_getUid("frameOfDataViewAtColumn:row:"),function(_76,_77,_78,_79){
with(_76){
var _7a=objj_msgSend(_76,"tableColumns")[_78];
if(_7a===_outlineTableColumn){
return objj_msgSend(_76,"frameOfOutlineDataViewAtColumn:row:",_78,_79);
}
return objj_msgSendSuper({receiver:_76,super_class:objj_getClass("CPOutlineView").super_class},"frameOfDataViewAtColumn:row:",_78,_79);
}
}),new objj_method(sel_getUid("setDropItem:dropChildIndex:"),function(_7b,_7c,_7d,_7e){
with(_7b){
_retargetedItem=_7d;
_shouldRetargetItem=YES;
_retargedChildIndex=_7e;
_shouldRetargetChildIndex=YES;
}
}),new objj_method(sel_getUid("_parentItemForUpperRow:andLowerRow:atMouseOffset:"),function(_7f,_80,_81,_82,_83){
with(_7f){
if(_shouldRetargetItem){
return _retargetedItem;
}
var _84=objj_msgSend(_7f,"levelForRow:",_82);
upperItem=objj_msgSend(_7f,"itemAtRow:",_81);
upperLevel=objj_msgSend(_7f,"levelForItem:",upperItem);
while(upperLevel>_84){
upperLevel=objj_msgSend(_7f,"levelForItem:",upperItem);
if(_83.x>(upperLevel+1)*objj_msgSend(_7f,"indentationPerLevel")){
return objj_msgSend(_7f,"parentForItem:",upperItem);
}
upperItem=objj_msgSend(_7f,"parentForItem:",upperItem);
}
return objj_msgSend(_7f,"parentForItem:",objj_msgSend(_7f,"itemAtRow:",_82));
}
}),new objj_method(sel_getUid("_rectForDropHighlightViewBetweenUpperRow:andLowerRow:offset:"),function(_85,_86,_87,_88,_89){
with(_85){
var _8a=objj_msgSendSuper({receiver:_85,super_class:objj_getClass("CPOutlineView").super_class},"_rectForDropHighlightViewBetweenUpperRow:andLowerRow:offset:",_87,_88,_89),_8b=objj_msgSend(_85,"_parentItemForUpperRow:andLowerRow:atMouseOffset:",_87,_88,_89),_8c=objj_msgSend(_85,"levelForItem:",_8b);
_8a.origin.x=(_8c+1)*objj_msgSend(_85,"indentationPerLevel");
_8a.size.width-=_8a.origin.x;
return _8a;
}
}),new objj_method(sel_getUid("_loadDataViewsInRows:columns:"),function(_8d,_8e,_8f,_90){
with(_8d){
objj_msgSendSuper({receiver:_8d,super_class:objj_getClass("CPOutlineView").super_class},"_loadDataViewsInRows:columns:",_8f,_90);
var _91=objj_msgSend(objj_msgSend(_8d,"tableColumns"),"indexOfObjectIdenticalTo:",objj_msgSend(_8d,"outlineTableColumn"));
if(!objj_msgSend(_90,"containsIndex:",_91)){
return;
}
var _92=[];
objj_msgSend(_8f,"getIndexes:maxCount:inIndexRange:",_92,-1,nil);
var _93=0,_94=_92.length;
for(;_93<_94;++_93){
var row=_92[_93],_95=_itemsForRows[row],_96=objj_msgSend(_8d,"isExpandable:",_95);
if(!_96){
continue;
}
var _97=objj_msgSend(_8d,"_dequeueDisclosureControl"),_98=objj_msgSend(_97,"frame"),_99=objj_msgSend(_8d,"frameOfDataViewAtColumn:row:",_91,row);
_98.origin.x=_indentationMarkerFollowsDataView?(_99.origin.x)-(_98.size.width):0;
_98.origin.y=(_99.origin.y);
_98.size.height=(_99.size.height);
_disclosureControlsForRows[row]=_97;
objj_msgSend(_97,"setState:",objj_msgSend(_8d,"isItemExpanded:",_95)?CPOnState:CPOffState);
objj_msgSend(_97,"setFrame:",_98);
objj_msgSend(_8d,"addSubview:",_97);
}
}
}),new objj_method(sel_getUid("_unloadDataViewsInRows:columns:"),function(_9a,_9b,_9c,_9d){
with(_9a){
objj_msgSendSuper({receiver:_9a,super_class:objj_getClass("CPOutlineView").super_class},"_unloadDataViewsInRows:columns:",_9c,_9d);
var _9e=objj_msgSend(objj_msgSend(_9a,"tableColumns"),"indexOfObjectIdenticalTo:",objj_msgSend(_9a,"outlineTableColumn"));
if(!objj_msgSend(_9d,"containsIndex:",_9e)){
return;
}
var _9f=[];
objj_msgSend(_9c,"getIndexes:maxCount:inIndexRange:",_9f,-1,nil);
var _a0=0,_a1=_9f.length;
for(;_a0<_a1;++_a0){
var row=_9f[_a0],_a2=_disclosureControlsForRows[row];
if(!_a2){
continue;
}
objj_msgSend(_a2,"removeFromSuperview");
objj_msgSend(_9a,"_enqueueDisclosureControl:",_a2);
_disclosureControlsForRows[row]=nil;
}
}
}),new objj_method(sel_getUid("_toggleFromDisclosureControl:"),function(_a3,_a4,_a5){
with(_a3){
var _a6=objj_msgSend(_a5,"frame"),_a7=objj_msgSend(_a3,"itemAtRow:",objj_msgSend(_a3,"rowAtPoint:",{x:(_a6.origin.x),y:(_a6.origin.y+(_a6.size.height)/2)}));
if(objj_msgSend(_a3,"isItemExpanded:",_a7)){
objj_msgSend(_a3,"collapseItem:",_a7);
}else{
objj_msgSend(_a3,"expandItem:",_a7);
}
}
}),new objj_method(sel_getUid("_enqueueDisclosureControl:"),function(_a8,_a9,_aa){
with(_a8){
_disclosureControlQueue.push(_aa);
}
}),new objj_method(sel_getUid("_dequeueDisclosureControl"),function(_ab,_ac){
with(_ab){
if(_disclosureControlQueue.length){
return _disclosureControlQueue.pop();
}
if(!_disclosureControlData){
if(!_disclosureControlPrototype){
return nil;
}else{
_disclosureControlData=objj_msgSend(CPKeyedArchiver,"archivedDataWithRootObject:",_disclosureControlPrototype);
}
}
var _ad=objj_msgSend(CPKeyedUnarchiver,"unarchiveObjectWithData:",_disclosureControlData);
objj_msgSend(_ad,"setTarget:",_ab);
objj_msgSend(_ad,"setAction:",sel_getUid("_toggleFromDisclosureControl:"));
return _ad;
}
}),new objj_method(sel_getUid("_noteSelectionIsChanging"),function(_ae,_af){
with(_ae){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:userInfo:",CPOutlineViewSelectionIsChangingNotification,_ae,nil);
}
}),new objj_method(sel_getUid("_noteSelectionDidChange"),function(_b0,_b1){
with(_b0){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:userInfo:",CPOutlineViewSelectionDidChangeNotification,_b0,nil);
}
})]);
var _38=function(_b2,_b3){
if(!_b3){
return;
}
with(_b2){
var _b4=_itemInfosForItems,_b5=_outlineViewDataSource,_b6=objj_msgSend(_b3,"UID"),_b7=_b4[_b6];
if(!_b7){
return [];
}
var _b8=_b7.parent,_b9=_b8?_b4[objj_msgSend(_b8,"UID")]:_rootItemInfo,_ba=_b9.children,_bb=objj_msgSend(_ba,"indexOfObjectIdenticalTo:",_b3),_bc=objj_msgSend(_b5,"outlineView:child:ofItem:",_b2,_bb,_b8);
if(_b3!==_bc){
_b4[objj_msgSend(_b3,"UID")]=nil;
_b4[objj_msgSend(_bc,"UID")]=_b7;
_ba[_bb]=_bc;
_itemsForRows[_b7.row]=_bc;
}
_b7.isExpandable=objj_msgSend(_b5,"outlineView:isItemExpandable:",_b2,_bc);
_b7.isExpanded=_b7.isExpandable&&_b7.isExpanded;
}
};
var _37=function(_bd,_be,_bf){
with(_bd){
var _c0=_itemInfosForItems,_c1=_outlineViewDataSource;
if(!_be){
var _c2=_rootItemInfo;
}else{
var _c3=objj_msgSend(_be,"UID"),_c2=_c0[_c3];
if(!_c2){
return [];
}
_c2.isExpandable=objj_msgSend(_c1,"outlineView:isItemExpandable:",_bd,_be);
if(!_c2.isExpandable&&_c2.isExpanded){
_c2.isExpanded=NO;
_c2.children=[];
}
}
var _c4=_c2.weight,_c5=_be?[_be]:[];
if(_c2.isExpanded&&(!(_implementedOutlineViewDataSourceMethods&_2)||!objj_msgSend(_c1,"outlineView:shouldDeferDisplayingChildrenOfItem:",_bd,_be))){
var _c6=0,_c7=objj_msgSend(_c1,"outlineView:numberOfChildrenOfItem:",_bd,_be),_c8=_c2.level+1;
_c2.children=[];
for(;_c6<_c7;++_c6){
var _c9=objj_msgSend(_c1,"outlineView:child:ofItem:",_bd,_c6,_be),_ca=_c0[objj_msgSend(_c9,"UID")];
if(!_ca){
_ca={isExpanded:NO,isExpandable:NO,children:[],weight:1};
_c0[objj_msgSend(_c9,"UID")]=_ca;
}
_c2.children[_c6]=_c9;
var _cb=_37(_bd,_c9,YES);
_ca.parent=_be;
_ca.level=_c8;
_c5=_c5.concat(_cb);
}
}
_c2.weight=_c5.length;
if(!_bf){
var _c6=MAX(_c2.row,0),_cc=_itemsForRows;
_c5.unshift(_c6,_c4);
_cc.splice.apply(_cc,_c5);
var _c7=_cc.length;
for(;_c6<_c7;++_c6){
_c0[objj_msgSend(_cc[_c6],"UID")].row=_c6;
}
var _cd=_c2.weight-_c4;
if(_cd!==0){
var _ce=_c2.parent;
while(_ce){
var _cf=_c0[objj_msgSend(_ce,"UID")];
_cf.weight+=_cd;
_ce=_cf.parent;
}
if(_be){
_rootItemInfo.weight+=_cd;
}
}
}
}
return _c5;
};
var _10=objj_allocateClassPair(CPObject,"_CPOutlineViewTableViewDataSource"),_11=_10.isa;
class_addIvars(_10,[new objj_ivar("_outlineView")]);
objj_registerClassPair(_10);
class_addMethods(_10,[new objj_method(sel_getUid("initWithOutlineView:"),function(_d0,_d1,_d2){
with(_d0){
_d0=objj_msgSendSuper({receiver:_d0,super_class:objj_getClass("_CPOutlineViewTableViewDataSource").super_class},"init");
if(_d0){
_outlineView=_d2;
}
return _d0;
}
}),new objj_method(sel_getUid("numberOfRowsInTableView:"),function(_d3,_d4,_d5){
with(_d3){
return _outlineView._itemsForRows.length;
}
}),new objj_method(sel_getUid("tableView:objectValueForTableColumn:row:"),function(_d6,_d7,_d8,_d9,_da){
with(_d6){
return objj_msgSend(_outlineView._outlineViewDataSource,"outlineView:objectValueForTableColumn:byItem:",_outlineView,_d9,_outlineView._itemsForRows[_da]);
}
}),new objj_method(sel_getUid("tableView:writeRowsWithIndexes:toPasteboard:"),function(_db,_dc,_dd,_de,_df){
with(_db){
if(!(_outlineView._implementedOutlineViewDataSourceMethods&_9)){
return NO;
}
var _e0=[];
objj_msgSend(_de,"getIndexes:maxCount:inIndexRange:",_e0,objj_msgSend(_de,"count"),nil);
var _e1=objj_msgSend(_e0,"count"),_e2=[];
while(_e1--){
objj_msgSend(_e2,"addObject:",objj_msgSend(_outlineView,"itemAtRow:",objj_msgSend(_e0,"objectAtIndex:",_e1)));
}
return objj_msgSend(_outlineView._outlineViewDataSource,"outlineView:writeItems:toPasteboard:",_outlineView,_e2,_df);
}
}),new objj_method(sel_getUid("_childIndexForDropOperation:row:offset:"),function(_e3,_e4,_e5,_e6,_e7){
with(_e3){
if(_outlineView._shouldRetargetChildIndex){
return _outlineView._retargedChildIndex;
}
var _e8=CPNotFound;
if(_e5===CPTableViewDropAbove){
var _e9=objj_msgSend(_outlineView,"_parentItemForUpperRow:andLowerRow:atMouseOffset:",_e6-1,_e6,_e7),_ea=(_e9!==nil)?_outlineView._itemInfosForItems[objj_msgSend(_e9,"UID")]:_outlineView._rootItemInfo,_eb=_ea.children;
_e8=objj_msgSend(_eb,"indexOfObject:",objj_msgSend(_outlineView,"itemAtRow:",_e6));
if(_e8===CPNotFound){
_e8=_eb.length;
}
}else{
if(_e5===CPTableViewDropOn){
_e8=-1;
}
}
return _e8;
}
}),new objj_method(sel_getUid("_parentItemForDropOperation:row:offset:"),function(_ec,_ed,_ee,_ef,_f0){
with(_ec){
if(_ee===CPTableViewDropAbove){
return objj_msgSend(_outlineView,"_parentItemForUpperRow:andLowerRow:atMouseOffset:",_ef-1,_ef,_f0);
}
return objj_msgSend(_outlineView,"itemAtRow:",_ef);
}
}),new objj_method(sel_getUid("tableView:validateDrop:proposedRow:proposedDropOperation:"),function(_f1,_f2,_f3,_f4,_f5,_f6){
with(_f1){
if(!(_outlineView._implementedOutlineViewDataSourceMethods&_4)){
return CPDragOperationNone;
}
_outlineView._retargetedItem=nil;
_outlineView._shouldRetargetItem=NO;
_outlineView._retargedChildIndex=nil;
_outlineView._shouldRetargetChildIndex=NO;
var _f7=objj_msgSend(_outlineView,"convertPoint:fromView:",objj_msgSend(_f4,"draggingLocation"),nil),_f8=objj_msgSend(_f1,"_parentItemForDropOperation:row:offset:",_f6,_f5,_f7);
childIndex=objj_msgSend(_f1,"_childIndexForDropOperation:row:offset:",_f6,_f5,_f7);
return objj_msgSend(_outlineView._outlineViewDataSource,"outlineView:validateDrop:proposedItem:proposedChildIndex:",_outlineView,_f4,_f8,childIndex);
}
}),new objj_method(sel_getUid("tableView:acceptDrop:row:dropOperation:"),function(_f9,_fa,_fb,_fc,_fd,_fe){
with(_f9){
if(!(_outlineView._implementedOutlineViewDataSourceMethods&_3)){
return NO;
}
var _ff=objj_msgSend(_outlineView,"convertPoint:fromView:",objj_msgSend(_fc,"draggingLocation"),nil),_100=objj_msgSend(_f9,"_parentItemForDropOperation:row:offset:",_fe,_fd,_ff);
childIndex=objj_msgSend(_f9,"_childIndexForDropOperation:row:offset:",_fe,_fd,_ff);
_outlineView._retargetedItem=nil;
_outlineView._shouldRetargetItem=NO;
_outlineView._retargedChildIndex=nil;
_outlineView._shouldRetargetChildIndex=NO;
return objj_msgSend(_outlineView._outlineViewDataSource,"outlineView:acceptDrop:item:childIndex:",_outlineView,_fc,_100,childIndex);
}
})]);
var _10=objj_allocateClassPair(CPObject,"_CPOutlineViewTableViewDelegate"),_11=_10.isa;
class_addIvars(_10,[new objj_ivar("_outlineView")]);
objj_registerClassPair(_10);
class_addMethods(_10,[new objj_method(sel_getUid("initWithOutlineView:"),function(self,_101,_102){
with(self){
self=objj_msgSendSuper({receiver:self,super_class:objj_getClass("_CPOutlineViewTableViewDelegate").super_class},"init");
if(self){
_outlineView=_102;
}
return self;
}
}),new objj_method(sel_getUid("tableView:dataViewForTableColumn:row:"),function(self,_103,_104,_105,_106){
with(self){
var _107=nil;
if((_outlineView._implementedOutlineViewDelegateMethods&_b)){
_107=objj_msgSend(_outlineView._outlineViewDelegate,"outlineView:dataViewForTableColumn:item:",_outlineView,_105,objj_msgSend(_outlineView,"itemAtRow:",_106));
}
if(!_107){
_107=objj_msgSend(_105,"dataViewForRow:",_106);
}
return _107;
}
}),new objj_method(sel_getUid("tableView:shouldSelectRow:"),function(self,_108,_109,_10a){
with(self){
if((_outlineView._implementedOutlineViewDelegateMethods&_c)){
return objj_msgSend(_outlineView._outlineViewDelegate,"outlineView:shouldSelectItem:",_outlineView,objj_msgSend(_outlineView,"itemAtRow:",_10a));
}
return YES;
}
}),new objj_method(sel_getUid("tableView:heightOfRow:"),function(self,_10b,_10c,_10d){
with(self){
if((_outlineView._implementedOutlineViewDelegateMethods&_d)){
return objj_msgSend(_outlineView._outlineViewDelegate,"outlineView:heightOfRowByItem:",_outlineView,objj_msgSend(_outlineView,"itemAtRow:",_10d));
}
return objj_msgSend(_10c,"rowHeight");
}
}),new objj_method(sel_getUid("tableView:willDisplayView:forTableColumn:row:"),function(self,_10e,_10f,_110,_111,_112){
with(self){
if((_outlineView._implementedOutlineViewDelegateMethods&_e)){
var item=objj_msgSend(_outlineView,"itemAtRow:",_112);
objj_msgSend(_outlineView._outlineViewDelegate,"outlineView:willDisplayView:forTableColumn:item:",_outlineView,_110,_111,item);
}
}
}),new objj_method(sel_getUid("tableView:isGroupRow:"),function(self,_113,_114,row){
with(self){
if((_outlineView._implementedOutlineViewDelegateMethods&_f)){
return objj_msgSend(_outlineView._outlineViewDelegate,"outlineView:isGroupItem:",_outlineView,objj_msgSend(_outlineView,"itemAtRow:",theRow));
}
return NO;
}
})]);
var _10=objj_allocateClassPair(CPButton,"CPDisclosureButton"),_11=_10.isa;
class_addIvars(_10,[new objj_ivar("_angle")]);
objj_registerClassPair(_10);
class_addMethods(_10,[new objj_method(sel_getUid("initWithFrame:"),function(self,_115,_116){
with(self){
self=objj_msgSendSuper({receiver:self,super_class:objj_getClass("CPDisclosureButton").super_class},"initWithFrame:",_116);
if(self){
objj_msgSend(self,"setBordered:",NO);
}
return self;
}
}),new objj_method(sel_getUid("setState:"),function(self,_117,_118){
with(self){
objj_msgSendSuper({receiver:self,super_class:objj_getClass("CPDisclosureButton").super_class},"setState:",_118);
if(objj_msgSend(self,"state")===CPOnState){
_angle=0;
}else{
_angle=-PI_2;
}
}
}),new objj_method(sel_getUid("drawRect:"),function(self,_119,_11a){
with(self){
var _11b=objj_msgSend(self,"bounds"),_11c=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort");
CGContextBeginPath(_11c);
CGContextTranslateCTM(_11c,(_11b.size.width)/2,(_11b.size.height)/2);
CGContextRotateCTM(_11c,_angle);
CGContextTranslateCTM(_11c,-(_11b.size.width)/2,-(_11b.size.height)/2);
CGContextTranslateCTM(_11c,FLOOR(((_11b.size.width)-9)/2),FLOOR(((_11b.size.height)-8)/2));
CGContextMoveToPoint(_11c,0,0);
CGContextAddLineToPoint(_11c,9,0);
CGContextAddLineToPoint(_11c,4.5,8);
CGContextAddLineToPoint(_11c,0,0);
CGContextClosePath(_11c);
CGContextSetFillColor(_11c,objj_msgSend(self,"isHighlighted")?objj_msgSend(CPColor,"whiteColor"):objj_msgSend(CPColor,"grayColor"));
CGContextFillPath(_11c);
}
})]);
p;9;CPPanel.jt;1172;@STATIC;1.0;i;10;CPWindow.jt;1138;
objj_executeFile("CPWindow.j",YES);
CPOKButton=1;
CPCancelButton=0;
CPDocModalWindowMask=1<<6;
var _1=objj_allocateClassPair(CPWindow,"CPPanel"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_becomesKeyOnlyIfNeeded"),new objj_ivar("_worksWhenModal")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("isFloatingPanel"),function(_3,_4){
with(_3){
return objj_msgSend(_3,"level")==CPFloatingWindowLevel;
}
}),new objj_method(sel_getUid("setFloatingPanel:"),function(_5,_6,_7){
with(_5){
objj_msgSend(_5,"setLevel:",_7?CPFloatingWindowLevel:CPNormalWindowLevel);
}
}),new objj_method(sel_getUid("becomesKeyOnlyIfNeeded"),function(_8,_9){
with(_8){
return _becomesKeyOnlyIfNeeded;
}
}),new objj_method(sel_getUid("setBecomesKeyOnlyIfNeeded:"),function(_a,_b,_c){
with(_a){
_becomesKeyOnlyIfNeeded=_c;
}
}),new objj_method(sel_getUid("worksWhenModal"),function(_d,_e){
with(_d){
return _worksWhenModal;
}
}),new objj_method(sel_getUid("setWorksWhenModal:"),function(_f,_10,_11){
with(_f){
_worksWhenModal=_11;
}
}),new objj_method(sel_getUid("canBecomeMainWindow"),function(_12,_13){
with(_12){
return NO;
}
})]);
p;14;CPPasteboard.jt;8393;@STATIC;1.0;I;21;Foundation/CPObject.jI;20;Foundation/CPArray.jI;25;Foundation/CPDictionary.jI;40;Foundation/CPPropertyListSerialization.jt;8248;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("Foundation/CPArray.j",NO);
objj_executeFile("Foundation/CPDictionary.j",NO);
objj_executeFile("Foundation/CPPropertyListSerialization.j",NO);
CPGeneralPboard="CPGeneralPboard";
CPFontPboard="CPFontPboard";
CPRulerPboard="CPRulerPboard";
CPFindPboard="CPFindPboard";
CPDragPboard="CPDragPboard";
CPColorPboardType="CPColorPboardType";
CPFilenamesPboardType="CPFilenamesPboardType";
CPFontPboardType="CPFontPboardType";
CPHTMLPboardType="CPHTMLPboardType";
CPStringPboardType="CPStringPboardType";
CPURLPboardType="CPURLPboardType";
CPImagesPboardType="CPImagesPboardType";
CPVideosPboardType="CPVideosPboardType";
UTF8PboardType="public.utf8-plain-text";
CPImagePboardType="CPImagePboardType";
var _1=nil,_2=NO;
var _3=objj_allocateClassPair(CPObject,"CPPasteboard"),_4=_3.isa;
class_addIvars(_3,[new objj_ivar("_types"),new objj_ivar("_owners"),new objj_ivar("_provided"),new objj_ivar("_changeCount"),new objj_ivar("_stateUID"),new objj_ivar("_nativePasteboard")]);
objj_registerClassPair(_3);
class_addMethods(_3,[new objj_method(sel_getUid("_initWithName:"),function(_5,_6,_7){
with(_5){
_5=objj_msgSendSuper({receiver:_5,super_class:objj_getClass("CPPasteboard").super_class},"init");
if(_5){
_name=_7;
_types=[];
_owners=objj_msgSend(CPDictionary,"dictionary");
_provided=objj_msgSend(CPDictionary,"dictionary");
_changeCount=0;
if(_2){
_nativePasteboard=window.cpPasteboardWithName(_7);
objj_msgSend(_5,"_synchronizePasteboard");
}
}
return _5;
}
}),new objj_method(sel_getUid("addTypes:owner:"),function(_8,_9,_a,_b){
with(_8){
var i=0,_c=_a.length;
for(;i<_c;++i){
var _d=_a[i];
if(!objj_msgSend(_owners,"objectForKey:",_d)){
objj_msgSend(_types,"addObject:",_d);
objj_msgSend(_provided,"removeObjectForKey:",_d);
}
objj_msgSend(_owners,"setObject:forKey:",_b,_d);
}
if(_nativePasteboard){
var _e=objj_msgSend(_a,"copy");
if(objj_msgSend(_a,"containsObject:",CPStringPboardType)){
_e.push(UTF8PboardType);
}
_nativePasteboard.addTypes_(_e);
}
return ++_changeCount;
}
}),new objj_method(sel_getUid("declareTypes:owner:"),function(_f,_10,_11,_12){
with(_f){
objj_msgSend(_f,"_declareTypes:owner:updateNativePasteboard:",_11,_12,YES);
}
}),new objj_method(sel_getUid("_declareTypes:owner:updateNativePasteboard:"),function(_13,_14,_15,_16,_17){
with(_13){
objj_msgSend(_types,"setArray:",_15);
_owners=objj_msgSend(CPDictionary,"dictionary");
_provided=objj_msgSend(CPDictionary,"dictionary");
var _18=_types.length;
while(_18--){
objj_msgSend(_owners,"setObject:forKey:",_16,_types[_18]);
}
if(_nativePasteboard&&_17){
var _19=objj_msgSend(_15,"copy");
if(objj_msgSend(_15,"containsObject:",CPStringPboardType)){
_19.push(UTF8PboardType);
}
_nativePasteboard.declareTypes_(_19);
_changeCount=_nativePasteboard.changeCount();
}
return ++_changeCount;
}
}),new objj_method(sel_getUid("setData:forType:"),function(_1a,_1b,_1c,_1d){
with(_1a){
objj_msgSend(_provided,"setObject:forKey:",_1c,_1d);
if(_1d===CPStringPboardType){
objj_msgSend(_1a,"setData:forType:",_1c,UTF8PboardType);
}
return YES;
}
}),new objj_method(sel_getUid("setPropertyList:forType:"),function(_1e,_1f,_20,_21){
with(_1e){
return objj_msgSend(_1e,"setData:forType:",objj_msgSend(CPPropertyListSerialization,"dataFromPropertyList:format:",_20,CPPropertyList280NorthFormat_v1_0),_21);
}
}),new objj_method(sel_getUid("setString:forType:"),function(_22,_23,_24,_25){
with(_22){
objj_msgSend(_22,"setPropertyList:forType:",_24,_25);
}
}),new objj_method(sel_getUid("availableTypeFromArray:"),function(_26,_27,_28){
with(_26){
return objj_msgSend(objj_msgSend(_26,"types"),"firstObjectCommonWithArray:",_28);
}
}),new objj_method(sel_getUid("types"),function(_29,_2a){
with(_29){
objj_msgSend(_29,"_synchronizePasteboard");
return _types;
}
}),new objj_method(sel_getUid("changeCount"),function(_2b,_2c){
with(_2b){
return _changeCount;
}
}),new objj_method(sel_getUid("dataForType:"),function(_2d,_2e,_2f){
with(_2d){
var _30=objj_msgSend(_provided,"objectForKey:",_2f);
if(_30){
return _30;
}
var _31=objj_msgSend(_owners,"objectForKey:",_2f);
if(_31){
objj_msgSend(_31,"pasteboard:provideDataForType:",_2d,_2f);
return objj_msgSend(_provided,"objectForKey:",_2f);
}
if(_2f===CPStringPboardType){
return objj_msgSend(_2d,"dataForType:",UTF8PboardType);
}
return nil;
}
}),new objj_method(sel_getUid("_synchronizePasteboard"),function(_32,_33){
with(_32){
if(_nativePasteboard&&_nativePasteboard.changeCount()>_changeCount){
var _34=objj_msgSend(_nativePasteboard.types(),"copy");
if(objj_msgSend(_34,"containsObject:",UTF8PboardType)){
_34.push(CPStringPboardType);
}
objj_msgSend(_32,"_declareTypes:owner:updateNativePasteboard:",_34,_32,NO);
_changeCount=_nativePasteboard.changeCount();
}
}
}),new objj_method(sel_getUid("pasteboard:provideDataForType:"),function(_35,_36,_37,_38){
with(_35){
if(_38===CPStringPboardType){
var _39=_nativePasteboard.stringForType_(UTF8PboardType);
objj_msgSend(_35,"setString:forType:",_39,CPStringPboardType);
objj_msgSend(_35,"setString:forType:",_39,UTF8PboardType);
}else{
objj_msgSend(_35,"setString:forType:",_nativePasteboard.stringForType_(_38),_38);
}
}
}),new objj_method(sel_getUid("propertyListForType:"),function(_3a,_3b,_3c){
with(_3a){
var _3d=objj_msgSend(_3a,"dataForType:",_3c);
if(_3d){
return objj_msgSend(CPPropertyListSerialization,"propertyListFromData:format:",_3d,CPPropertyList280NorthFormat_v1_0);
}
return nil;
}
}),new objj_method(sel_getUid("stringForType:"),function(_3e,_3f,_40){
with(_3e){
return objj_msgSend(_3e,"propertyListForType:",_40);
}
}),new objj_method(sel_getUid("_generateStateUID"),function(_41,_42){
with(_41){
var _43=32;
_stateUID="";
while(_43--){
_stateUID+=FLOOR(RAND()*16).toString(16).toUpperCase();
}
return _stateUID;
}
}),new objj_method(sel_getUid("_stateUID"),function(_44,_45){
with(_44){
return _stateUID;
}
})]);
class_addMethods(_4,[new objj_method(sel_getUid("initialize"),function(_46,_47){
with(_46){
if(_46!=objj_msgSend(CPPasteboard,"class")){
return;
}
objj_msgSend(_46,"setVersion:",1);
_1=objj_msgSend(CPDictionary,"dictionary");
if(typeof window.cpPasteboardWithName!=="undefined"){
_2=YES;
}
}
}),new objj_method(sel_getUid("generalPasteboard"),function(_48,_49){
with(_48){
return objj_msgSend(CPPasteboard,"pasteboardWithName:",CPGeneralPboard);
}
}),new objj_method(sel_getUid("pasteboardWithName:"),function(_4a,_4b,_4c){
with(_4a){
var _4d=objj_msgSend(_1,"objectForKey:",_4c);
if(_4d){
return _4d;
}
_4d=objj_msgSend(objj_msgSend(CPPasteboard,"alloc"),"_initWithName:",_4c);
objj_msgSend(_1,"setObject:forKey:",_4d,_4c);
return _4d;
}
})]);
var _4e=nil;
var _3=objj_allocateClassPair(CPPasteboard,"_CPDOMDataTransferPasteboard"),_4=_3.isa;
class_addIvars(_3,[new objj_ivar("_dataTransfer")]);
objj_registerClassPair(_3);
class_addMethods(_3,[new objj_method(sel_getUid("_setDataTransfer:"),function(_4f,_50,_51){
with(_4f){
_dataTransfer=_51;
}
}),new objj_method(sel_getUid("_setPasteboard:"),function(_52,_53,_54){
with(_52){
_dataTransfer.clearData();
var _55=objj_msgSend(_54,"types"),_56=_55.length;
while(_56--){
var _57=_55[_56];
if(_57===CPStringPboardType){
_dataTransfer.setData(_57,objj_msgSend(_54,"stringForType:",_57));
}else{
_dataTransfer.setData(_57,objj_msgSend(objj_msgSend(_54,"dataForType:",_57),"rawString"));
}
}
}
}),new objj_method(sel_getUid("types"),function(_58,_59){
with(_58){
return Array.prototype.slice.apply(_dataTransfer.types);
}
}),new objj_method(sel_getUid("dataForType:"),function(_5a,_5b,_5c){
with(_5a){
var _5d=_dataTransfer.getData(_5c);
if(_5c===CPStringPboardType){
return objj_msgSend(CPData,"dataFromPropertyList:format:",_5d,kCFPropertyList280NorthFormat_v1_0);
}
return objj_msgSend(CPData,"dataWithRawString:",_5d);
}
}),new objj_method(sel_getUid("propertyListForType:"),function(_5e,_5f,_60){
with(_5e){
if(_60===CPStringPboardType){
return _dataTransfer.getData(_60);
}
return objj_msgSend(CPPropertyListSerialization,"propertyListFromData:format:",objj_msgSend(_5e,"dataForType:",_60),CPPropertyListUnknownFormat);
}
})]);
class_addMethods(_4,[new objj_method(sel_getUid("DOMDataTransferPasteboard"),function(_61,_62){
with(_61){
if(!_4e){
_4e=objj_msgSend(objj_msgSend(_CPDOMDataTransferPasteboard,"alloc"),"init");
}
return _4e;
}
})]);
p;15;CPPopUpButton.jt;13015;@STATIC;1.0;i;10;CPButton.ji;12;CPGeometry.ji;8;CPMenu.ji;12;CPMenuItem.jt;12934;
objj_executeFile("CPButton.j",YES);
objj_executeFile("CPGeometry.j",YES);
objj_executeFile("CPMenu.j",YES);
objj_executeFile("CPMenuItem.j",YES);
var _1=7;
CPPopUpButtonStatePullsDown=CPThemeState("pulls-down");
var _2=objj_allocateClassPair(CPButton,"CPPopUpButton"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_selectedIndex"),new objj_ivar("_preferredEdge"),new objj_ivar("_menu")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("initWithFrame:pullsDown:"),function(_4,_5,_6,_7){
with(_4){
_4=objj_msgSendSuper({receiver:_4,super_class:objj_getClass("CPPopUpButton").super_class},"initWithFrame:",_6);
if(_4){
_selectedIndex=CPNotFound;
_preferredEdge=CPMaxYEdge;
objj_msgSend(_4,"setValue:forThemeAttribute:",CPImageLeft,"image-position");
objj_msgSend(_4,"setValue:forThemeAttribute:",CPLeftTextAlignment,"alignment");
objj_msgSend(_4,"setValue:forThemeAttribute:",CPLineBreakByTruncatingTail,"line-break-mode");
objj_msgSend(_4,"setMenu:",objj_msgSend(objj_msgSend(CPMenu,"alloc"),"initWithTitle:",""));
objj_msgSend(_4,"setPullsDown:",_7);
}
return _4;
}
}),new objj_method(sel_getUid("initWithFrame:"),function(_8,_9,_a){
with(_8){
return objj_msgSend(_8,"initWithFrame:pullsDown:",_a,NO);
}
}),new objj_method(sel_getUid("setPullsDown:"),function(_b,_c,_d){
with(_b){
if(_d){
var _e=objj_msgSend(_b,"setThemeState:",CPPopUpButtonStatePullsDown);
}else{
var _e=objj_msgSend(_b,"unsetThemeState:",CPPopUpButtonStatePullsDown);
}
if(!_e){
return;
}
var _f=objj_msgSend(_menu,"itemArray");
if(objj_msgSend(_f,"count")<=0){
return;
}
objj_msgSend(_f[0],"setHidden:",objj_msgSend(_b,"pullsDown"));
objj_msgSend(_b,"synchronizeTitleAndSelectedItem");
}
}),new objj_method(sel_getUid("pullsDown"),function(_10,_11){
with(_10){
return objj_msgSend(_10,"hasThemeState:",CPPopUpButtonStatePullsDown);
}
}),new objj_method(sel_getUid("addItem:"),function(_12,_13,_14){
with(_12){
objj_msgSend(_menu,"addItem:",_14);
}
}),new objj_method(sel_getUid("addItemWithTitle:"),function(_15,_16,_17){
with(_15){
objj_msgSend(_menu,"addItemWithTitle:action:keyEquivalent:",_17,NULL,nil);
}
}),new objj_method(sel_getUid("addItemsWithTitles:"),function(_18,_19,_1a){
with(_18){
var _1b=0,_1c=objj_msgSend(_1a,"count");
for(;_1b<_1c;++_1b){
objj_msgSend(_18,"addItemWithTitle:",_1a[_1b]);
}
}
}),new objj_method(sel_getUid("insertItemWithTitle:atIndex:"),function(_1d,_1e,_1f,_20){
with(_1d){
var _21=objj_msgSend(_1d,"itemArray"),_22=objj_msgSend(_21,"count");
while(_22--){
if(objj_msgSend(_21[_22],"title")==_1f){
objj_msgSend(_1d,"removeItemAtIndex:",_22);
}
}
objj_msgSend(_menu,"insertItemWithTitle:action:keyEquivalent:atIndex:",_1f,NULL,nil,_20);
}
}),new objj_method(sel_getUid("removeAllItems"),function(_23,_24){
with(_23){
var _25=objj_msgSend(_menu,"numberOfItems");
while(_25--){
objj_msgSend(_menu,"removeItemAtIndex:",0);
}
}
}),new objj_method(sel_getUid("removeItemWithTitle:"),function(_26,_27,_28){
with(_26){
objj_msgSend(_26,"removeItemAtIndex:",objj_msgSend(_26,"indexOfItemWithTitle:",_28));
objj_msgSend(_26,"synchronizeTitleAndSelectedItem");
}
}),new objj_method(sel_getUid("removeItemAtIndex:"),function(_29,_2a,_2b){
with(_29){
objj_msgSend(_menu,"removeItemAtIndex:",_2b);
objj_msgSend(_29,"synchronizeTitleAndSelectedItem");
}
}),new objj_method(sel_getUid("selectedItem"),function(_2c,_2d){
with(_2c){
if(_selectedIndex<0||_selectedIndex>objj_msgSend(_2c,"numberOfItems")-1){
return nil;
}
return objj_msgSend(_menu,"itemAtIndex:",_selectedIndex);
}
}),new objj_method(sel_getUid("titleOfSelectedItem"),function(_2e,_2f){
with(_2e){
return objj_msgSend(objj_msgSend(_2e,"selectedItem"),"title");
}
}),new objj_method(sel_getUid("indexOfSelectedItem"),function(_30,_31){
with(_30){
return _selectedIndex;
}
}),new objj_method(sel_getUid("objectValue"),function(_32,_33){
with(_32){
return _selectedIndex;
}
}),new objj_method(sel_getUid("selectItem:"),function(_34,_35,_36){
with(_34){
objj_msgSend(_34,"selectItemAtIndex:",objj_msgSend(_34,"indexOfItem:",_36));
}
}),new objj_method(sel_getUid("selectItemAtIndex:"),function(_37,_38,_39){
with(_37){
if(_selectedIndex==_39){
return;
}
if(_selectedIndex>=0&&!objj_msgSend(_37,"pullsDown")){
objj_msgSend(objj_msgSend(_37,"selectedItem"),"setState:",CPOffState);
}
_selectedIndex=_39;
if(_selectedIndex>=0&&!objj_msgSend(_37,"pullsDown")){
objj_msgSend(objj_msgSend(_37,"selectedItem"),"setState:",CPOnState);
}
objj_msgSend(_37,"synchronizeTitleAndSelectedItem");
}
}),new objj_method(sel_getUid("selectItemWithTag:"),function(_3a,_3b,_3c){
with(_3a){
objj_msgSend(_3a,"selectItemAtIndex:",objj_msgSend(_3a,"indexOfItemWithTag:",_3c));
}
}),new objj_method(sel_getUid("selectItemWithTitle:"),function(_3d,_3e,_3f){
with(_3d){
objj_msgSend(_3d,"selectItemAtIndex:",objj_msgSend(_3d,"indexOfItemWithTitle:",_3f));
}
}),new objj_method(sel_getUid("setObjectValue:"),function(_40,_41,_42){
with(_40){
objj_msgSend(_40,"selectItemAtIndex:",objj_msgSend(_42,"intValue"));
}
}),new objj_method(sel_getUid("menu"),function(_43,_44){
with(_43){
return _menu;
}
}),new objj_method(sel_getUid("setMenu:"),function(_45,_46,_47){
with(_45){
if(_menu===_47){
return;
}
var _48=objj_msgSend(CPNotificationCenter,"defaultCenter");
if(_menu){
objj_msgSend(_48,"removeObserver:name:object:",_45,CPMenuDidAddItemNotification,_menu);
objj_msgSend(_48,"removeObserver:name:object:",_45,CPMenuDidChangeItemNotification,_menu);
objj_msgSend(_48,"removeObserver:name:object:",_45,CPMenuDidRemoveItemNotification,_menu);
}
_menu=_47;
if(_menu){
objj_msgSend(_48,"addObserver:selector:name:object:",_45,sel_getUid("menuDidAddItem:"),CPMenuDidAddItemNotification,_menu);
objj_msgSend(_48,"addObserver:selector:name:object:",_45,sel_getUid("menuDidChangeItem:"),CPMenuDidChangeItemNotification,_menu);
objj_msgSend(_48,"addObserver:selector:name:object:",_45,sel_getUid("menuDidRemoveItem:"),CPMenuDidRemoveItemNotification,_menu);
}
objj_msgSend(_45,"synchronizeTitleAndSelectedItem");
}
}),new objj_method(sel_getUid("numberOfItems"),function(_49,_4a){
with(_49){
return objj_msgSend(_menu,"numberOfItems");
}
}),new objj_method(sel_getUid("itemArray"),function(_4b,_4c){
with(_4b){
return objj_msgSend(_menu,"itemArray");
}
}),new objj_method(sel_getUid("itemAtIndex:"),function(_4d,_4e,_4f){
with(_4d){
return objj_msgSend(_menu,"itemAtIndex:",_4f);
}
}),new objj_method(sel_getUid("itemTitleAtIndex:"),function(_50,_51,_52){
with(_50){
return objj_msgSend(objj_msgSend(_menu,"itemAtIndex:",_52),"title");
}
}),new objj_method(sel_getUid("itemTitles"),function(_53,_54){
with(_53){
var _55=[],_56=objj_msgSend(_53,"itemArray"),_57=0,_58=objj_msgSend(_56,"count");
for(;_57<_58;++_57){
_56.push(objj_msgSend(_56[_57],"title"));
}
}
}),new objj_method(sel_getUid("itemWithTitle:"),function(_59,_5a,_5b){
with(_59){
return objj_msgSend(_menu,"itemAtIndex:",objj_msgSend(_menu,"indexOfItemWithTitle:",_5b));
}
}),new objj_method(sel_getUid("lastItem"),function(_5c,_5d){
with(_5c){
return objj_msgSend(objj_msgSend(_menu,"itemArray"),"lastObject");
}
}),new objj_method(sel_getUid("indexOfItem:"),function(_5e,_5f,_60){
with(_5e){
return objj_msgSend(_menu,"indexOfItem:",_60);
}
}),new objj_method(sel_getUid("indexOfItemWithTag:"),function(_61,_62,_63){
with(_61){
return objj_msgSend(_menu,"indexOfItemWithTag:",_63);
}
}),new objj_method(sel_getUid("indexOfItemWithTitle:"),function(_64,_65,_66){
with(_64){
return objj_msgSend(_menu,"indexOfItemWithTitle:",_66);
}
}),new objj_method(sel_getUid("indexOfItemWithRepresentedObject:"),function(_67,_68,_69){
with(_67){
return objj_msgSend(_menu,"indexOfItemWithRepresentedObject:",_69);
}
}),new objj_method(sel_getUid("indexOfItemWithTarget:action:"),function(_6a,_6b,_6c,_6d){
with(_6a){
return objj_msgSend(_menu,"indexOfItemWithTarget:action:",_6c,_6d);
}
}),new objj_method(sel_getUid("preferredEdge"),function(_6e,_6f){
with(_6e){
return _preferredEdge;
}
}),new objj_method(sel_getUid("setPreferredEdge:"),function(_70,_71,_72){
with(_70){
_preferredEdge=_72;
}
}),new objj_method(sel_getUid("setTitle:"),function(_73,_74,_75){
with(_73){
if(objj_msgSend(_73,"title")===_75){
return;
}
if(objj_msgSend(_73,"pullsDown")){
var _76=objj_msgSend(_menu,"itemArray");
if(objj_msgSend(_76,"count")<=0){
objj_msgSend(_73,"addItemWithTitle:",_75);
}else{
objj_msgSend(_76[0],"setTitle:",_75);
objj_msgSend(_73,"synchronizeTitleAndSelectedItem");
}
}else{
var _77=objj_msgSend(_73,"indexOfItemWithTitle:",_75);
if(_77<0){
objj_msgSend(_73,"addItemWithTitle:",_75);
_77=objj_msgSend(_73,"numberOfItems")-1;
}
objj_msgSend(_73,"selectItemAtIndex:",_77);
}
}
}),new objj_method(sel_getUid("setImage:"),function(_78,_79,_7a){
with(_78){
}
}),new objj_method(sel_getUid("synchronizeTitleAndSelectedItem"),function(_7b,_7c){
with(_7b){
var _7d=nil;
if(objj_msgSend(_7b,"pullsDown")){
var _7e=objj_msgSend(_menu,"itemArray");
if(objj_msgSend(_7e,"count")>0){
_7d=_7e[0];
}
}else{
_7d=objj_msgSend(_7b,"selectedItem");
}
objj_msgSendSuper({receiver:_7b,super_class:objj_getClass("CPPopUpButton").super_class},"setImage:",objj_msgSend(_7d,"image"));
objj_msgSendSuper({receiver:_7b,super_class:objj_getClass("CPPopUpButton").super_class},"setTitle:",objj_msgSend(_7d,"title"));
}
}),new objj_method(sel_getUid("menuDidAddItem:"),function(_7f,_80,_81){
with(_7f){
var _82=objj_msgSend(objj_msgSend(_81,"userInfo"),"objectForKey:","CPMenuItemIndex");
if(_selectedIndex<0){
objj_msgSend(_7f,"selectItemAtIndex:",0);
}else{
if(_82==_selectedIndex){
objj_msgSend(_7f,"synchronizeTitleAndSelectedItem");
}else{
if(_82<_selectedIndex){
++_selectedIndex;
}
}
}
if(_82==0&&objj_msgSend(_7f,"pullsDown")){
var _83=objj_msgSend(_menu,"itemArray");
objj_msgSend(_83[0],"setHidden:",YES);
if(_83.length>0){
objj_msgSend(_83[1],"setHidden:",NO);
}
}
var _84=objj_msgSend(_menu,"itemArray")[_82],_85=objj_msgSend(_84,"action");
if(!_85||(_85===sel_getUid("_popUpItemAction:"))){
objj_msgSend(_84,"setTarget:",_7f);
objj_msgSend(_84,"setAction:",sel_getUid("_popUpItemAction:"));
}
}
}),new objj_method(sel_getUid("menuDidChangeItem:"),function(_86,_87,_88){
with(_86){
var _89=objj_msgSend(objj_msgSend(_88,"userInfo"),"objectForKey:","CPMenuItemIndex");
if(objj_msgSend(_86,"pullsDown")&&_89!=0){
return;
}
if(!objj_msgSend(_86,"pullsDown")&&_89!=_selectedIndex){
return;
}
objj_msgSend(_86,"synchronizeTitleAndSelectedItem");
}
}),new objj_method(sel_getUid("menuDidRemoveItem:"),function(_8a,_8b,_8c){
with(_8a){
var _8d=objj_msgSend(_8a,"numberOfItems");
if(_8d<=_selectedIndex&&_8d>0){
objj_msgSend(_8a,"selectItemAtIndex:",_8d-1);
}else{
objj_msgSend(_8a,"synchronizeTitleAndSelectedItem");
}
}
}),new objj_method(sel_getUid("mouseDown:"),function(_8e,_8f,_90){
with(_8e){
if(!objj_msgSend(_8e,"isEnabled")||!objj_msgSend(_8e,"numberOfItems")){
return;
}
objj_msgSend(_8e,"highlight:",YES);
var _91=objj_msgSend(_8e,"menu"),_92=objj_msgSend(_8e,"bounds"),_93=CGRectGetWidth(_92);
objj_msgSend(_91,"setFont:",objj_msgSend(_8e,"font"));
if(objj_msgSend(_8e,"pullsDown")){
var _94=nil,_95=CGPointMake(0,CGRectGetMaxY(_92));
}else{
var _96=objj_msgSend(_8e,"contentRectForBounds:",_92),_94=objj_msgSend(_8e,"selectedItem"),_97=objj_msgSend(_CPMenuWindow,"_standardLeftMargin")+objj_msgSend(_CPMenuItemStandardView,"_standardLeftMargin"),_95=CGPointMake(CGRectGetMinX(_96)-_97,0);
_93+=_97;
}
objj_msgSend(_91,"setMinimumWidth:",_93);
objj_msgSend(_91,"_popUpMenuPositioningItem:atLocation:topY:bottomY:inView:callback:",_94,_95,CGRectGetMinY(_92),CGRectGetMaxY(_92),_8e,function(_98){
objj_msgSend(_8e,"highlight:",NO);
var _99=objj_msgSend(_98,"highlightedItem");
if(objj_msgSend(_99,"_isSelectable")){
objj_msgSend(_8e,"selectItem:",_99);
}
});
}
}),new objj_method(sel_getUid("_popUpItemAction:"),function(_9a,_9b,_9c){
with(_9a){
objj_msgSend(_9a,"sendAction:to:",objj_msgSend(_9a,"action"),objj_msgSend(_9a,"target"));
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("themeClass"),function(_9d,_9e){
with(_9d){
return "popup-button";
}
})]);
var _9f="CPPopUpButtonMenuKey",_a0="CPPopUpButtonSelectedIndexKey",_a1="CPPopUpButtonPullsDownKey";
var _2=objj_getClass("CPPopUpButton");
if(!_2){
throw new SyntaxError("*** Could not find definition for class \"CPPopUpButton\"");
}
var _3=_2.isa;
class_addMethods(_2,[new objj_method(sel_getUid("initWithCoder:"),function(_a2,_a3,_a4){
with(_a2){
_a2=objj_msgSendSuper({receiver:_a2,super_class:objj_getClass("CPPopUpButton").super_class},"initWithCoder:",_a4);
if(_a2){
_selectedIndex=-1;
objj_msgSend(_a2,"setMenu:",objj_msgSend(_a4,"decodeObjectForKey:",_9f));
objj_msgSend(_a2,"selectItemAtIndex:",objj_msgSend(_a4,"decodeObjectForKey:",_a0));
}
return _a2;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_a5,_a6,_a7){
with(_a5){
objj_msgSendSuper({receiver:_a5,super_class:objj_getClass("CPPopUpButton").super_class},"encodeWithCoder:",_a7);
objj_msgSend(_a7,"encodeObject:forKey:",_menu,_9f);
objj_msgSend(_a7,"encodeInt:forKey:",_selectedIndex,_a0);
}
})]);
p;21;CPProgressIndicator.jt;8302;@STATIC;1.0;I;19;AppKit/CGGeometry.jI;20;AppKit/CPImageView.jI;15;AppKit/CPView.jt;8214;
objj_executeFile("AppKit/CGGeometry.j",NO);
objj_executeFile("AppKit/CPImageView.j",NO);
objj_executeFile("AppKit/CPView.j",NO);
CPProgressIndicatorBarStyle=0;
CPProgressIndicatorSpinningStyle=1;
CPProgressIndicatorHUDBarStyle=2;
var _1=nil,_2=nil,_3=nil,_4=nil;
var _5=objj_allocateClassPair(CPView,"CPProgressIndicator"),_6=_5.isa;
class_addIvars(_5,[new objj_ivar("_minValue"),new objj_ivar("_maxValue"),new objj_ivar("_doubleValue"),new objj_ivar("_controlSize"),new objj_ivar("_isIndeterminate"),new objj_ivar("_style"),new objj_ivar("_isAnimating"),new objj_ivar("_isDisplayedWhenStoppedSet"),new objj_ivar("_isDisplayedWhenStopped"),new objj_ivar("_barView")]);
objj_registerClassPair(_5);
class_addMethods(_5,[new objj_method(sel_getUid("initWithFrame:"),function(_7,_8,_9){
with(_7){
_7=objj_msgSendSuper({receiver:_7,super_class:objj_getClass("CPProgressIndicator").super_class},"initWithFrame:",_9);
if(_7){
_minValue=0;
_maxValue=100;
_doubleValue=0;
_style=CPProgressIndicatorBarStyle;
_isDisplayedWhenStoppedSet=NO;
_controlSize=CPRegularControlSize;
objj_msgSend(_7,"updateBackgroundColor");
objj_msgSend(_7,"drawBar");
}
return _7;
}
}),new objj_method(sel_getUid("setUsesThreadedAnimation:"),function(_a,_b,_c){
with(_a){
}
}),new objj_method(sel_getUid("startAnimation:"),function(_d,_e,_f){
with(_d){
_isAnimating=YES;
objj_msgSend(_d,"_hideOrDisplay");
}
}),new objj_method(sel_getUid("stopAnimation:"),function(_10,_11,_12){
with(_10){
_isAnimating=NO;
objj_msgSend(_10,"_hideOrDisplay");
}
}),new objj_method(sel_getUid("usesThreadedAnimation"),function(_13,_14){
with(_13){
return NO;
}
}),new objj_method(sel_getUid("incrementBy:"),function(_15,_16,_17){
with(_15){
objj_msgSend(_15,"setDoubleValue:",_doubleValue+_17);
}
}),new objj_method(sel_getUid("setDoubleValue:"),function(_18,_19,_1a){
with(_18){
_doubleValue=MIN(MAX(_1a,_minValue),_maxValue);
objj_msgSend(_18,"drawBar");
}
}),new objj_method(sel_getUid("doubleValue"),function(_1b,_1c){
with(_1b){
return _doubleValue;
}
}),new objj_method(sel_getUid("setMinValue:"),function(_1d,_1e,_1f){
with(_1d){
_minValue=_1f;
}
}),new objj_method(sel_getUid("minValue"),function(_20,_21){
with(_20){
return _minValue;
}
}),new objj_method(sel_getUid("setMaxValue:"),function(_22,_23,_24){
with(_22){
_maxValue=_24;
}
}),new objj_method(sel_getUid("maxValue"),function(_25,_26){
with(_25){
return _maxValue;
}
}),new objj_method(sel_getUid("setControlSize:"),function(_27,_28,_29){
with(_27){
if(_controlSize==_29){
return;
}
_controlSize=_29;
objj_msgSend(_27,"updateBackgroundColor");
}
}),new objj_method(sel_getUid("controlSize"),function(_2a,_2b){
with(_2a){
return _controlSize;
}
}),new objj_method(sel_getUid("setControlTint:"),function(_2c,_2d,_2e){
with(_2c){
}
}),new objj_method(sel_getUid("controlTint"),function(_2f,_30){
with(_2f){
return 0;
}
}),new objj_method(sel_getUid("setBezeled:"),function(_31,_32,_33){
with(_31){
}
}),new objj_method(sel_getUid("isBezeled"),function(_34,_35){
with(_34){
return YES;
}
}),new objj_method(sel_getUid("setIndeterminate:"),function(_36,_37,_38){
with(_36){
if(_isIndeterminate==_38){
return;
}
_isIndeterminate=_38;
objj_msgSend(_36,"updateBackgroundColor");
}
}),new objj_method(sel_getUid("isIndeterminate"),function(_39,_3a){
with(_39){
return _isIndeterminate;
}
}),new objj_method(sel_getUid("setStyle:"),function(_3b,_3c,_3d){
with(_3b){
if(_style==_3d){
return;
}
_style=_3d;
objj_msgSend(_3b,"updateBackgroundColor");
}
}),new objj_method(sel_getUid("sizeToFit"),function(_3e,_3f){
with(_3e){
if(_style==CPProgressIndicatorSpinningStyle){
objj_msgSend(_3e,"setFrameSize:",objj_msgSend(objj_msgSend(_1[_controlSize],"patternImage"),"size"));
}else{
objj_msgSend(_3e,"setFrameSize:",CGSizeMake(CGRectGetWidth(objj_msgSend(_3e,"frame")),_4[_2+"BezelBorder"+_3[CPProgressIndicatorBarStyle]+_CPControlIdentifierForControlSize(_controlSize)][0].height));
}
}
}),new objj_method(sel_getUid("setDisplayedWhenStopped:"),function(_40,_41,_42){
with(_40){
if(_isDisplayedWhenStoppedSet&&_isDisplayedWhenStopped==_42){
return;
}
_isDisplayedWhenStoppedSet=YES;
_isDisplayedWhenStopped=_42;
objj_msgSend(_40,"_hideOrDisplay");
}
}),new objj_method(sel_getUid("isDisplayedWhenStopped"),function(_43,_44){
with(_43){
if(_isDisplayedWhenStoppedSet){
return _isDisplayedWhenStopped;
}
if(_style==CPProgressIndicatorBarStyle||_style==CPProgressIndicatorHUDBarStyle){
return YES;
}
return NO;
}
}),new objj_method(sel_getUid("_hideOrDisplay"),function(_45,_46){
with(_45){
objj_msgSend(_45,"setHidden:",!_isAnimating&&!objj_msgSend(_45,"isDisplayedWhenStopped"));
}
}),new objj_method(sel_getUid("setFrameSize:"),function(_47,_48,_49){
with(_47){
objj_msgSendSuper({receiver:_47,super_class:objj_getClass("CPProgressIndicator").super_class},"setFrameSize:",_49);
objj_msgSend(_47,"drawBar");
}
}),new objj_method(sel_getUid("drawBar"),function(_4a,_4b){
with(_4a){
if(_style==CPProgressIndicatorSpinningStyle){
return;
}
if(!_barView){
_barView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMake(0,0,0,16));
objj_msgSend(_4a,"addSubview:",_barView);
}
objj_msgSend(_barView,"setBackgroundColor:",_CPControlThreePartImagePattern(NO,_4,_2,"Bar",_3[_style],_CPControlIdentifierForControlSize(_controlSize)));
var _4c=CGRectGetWidth(objj_msgSend(_4a,"bounds")),_4d=_4c*((_doubleValue-_minValue)/(_maxValue-_minValue));
if(_4d>0&&_4d<4){
_4d=4;
}
objj_msgSend(_barView,"setFrameSize:",CGSizeMake(_4d,16));
}
}),new objj_method(sel_getUid("updateBackgroundColor"),function(_4e,_4f){
with(_4e){
if(YES){
if(_style==CPProgressIndicatorSpinningStyle){
objj_msgSend(_barView,"removeFromSuperview");
_barView=nil;
objj_msgSend(_4e,"setBackgroundColor:",_1[_controlSize]);
}else{
objj_msgSend(_4e,"setBackgroundColor:",_CPControlThreePartImagePattern(NO,_4,_2,"BezelBorder",_3[_style],_CPControlIdentifierForControlSize(_controlSize)));
objj_msgSend(_4e,"drawBar");
}
}else{
objj_msgSend(_4e,"setBackgroundColor:",nil);
}
}
})]);
class_addMethods(_6,[new objj_method(sel_getUid("initialize"),function(_50,_51){
with(_50){
if(_50!=objj_msgSend(CPProgressIndicator,"class")){
return;
}
var _52=objj_msgSend(CPBundle,"bundleForClass:",_50);
_1=[];
_1[CPMiniControlSize]=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_52,"pathForResource:","CPProgressIndicator/CPProgressIndicatorSpinningStyleRegular.gif"),CGSizeMake(64,64)));
_1[CPSmallControlSize]=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_52,"pathForResource:","CPProgressIndicator/CPProgressIndicatorSpinningStyleRegular.gif"),CGSizeMake(64,64)));
_1[CPRegularControlSize]=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_52,"pathForResource:","CPProgressIndicator/CPProgressIndicatorSpinningStyleRegular.gif"),CGSizeMake(64,64)));
CPProgressIndicatorBezelBorderViewPool=[];
var _53=CPProgressIndicatorBarStyle,end=CPProgressIndicatorHUDBarStyle;
for(;_53<=end;++_53){
CPProgressIndicatorBezelBorderViewPool[_53]=[];
CPProgressIndicatorBezelBorderViewPool[_53][CPMiniControlSize]=[];
CPProgressIndicatorBezelBorderViewPool[_53][CPSmallControlSize]=[];
CPProgressIndicatorBezelBorderViewPool[_53][CPRegularControlSize]=[];
}
_2=objj_msgSend(_50,"className");
_3=[];
_3[CPProgressIndicatorBarStyle]="Bar";
_3[CPProgressIndicatorSpinningStyle]="Spinny";
_3[CPProgressIndicatorHUDBarStyle]="HUDBar";
var _54=_CPControlIdentifierForControlSize(CPRegularControlSize),_55=_CPControlIdentifierForControlSize(CPSmallControlSize),_56=_CPControlIdentifierForControlSize(CPMiniControlSize);
_4=[];
var _57=[_2+"BezelBorder"+_3[CPProgressIndicatorBarStyle],_2+"Bar"+_3[CPProgressIndicatorBarStyle],_2+"BezelBorder"+_3[CPProgressIndicatorHUDBarStyle],_2+"Bar"+_3[CPProgressIndicatorHUDBarStyle]];
for(var i=0,_58=_57.length;i<_58;i++){
var _59=_57[i];
_4[_59+_54]=[{width:3,height:16},{width:1,height:16},{width:3,height:16}];
_4[_59+_55]=[{width:3,height:16},{width:1,height:16},{width:3,height:16}];
_4[_59+_56]=[{width:3,height:16},{width:1,height:16},{width:3,height:16}];
}
}
})]);
p;9;CPRadio.jt;5542;@STATIC;1.0;I;21;Foundation/CPObject.jI;18;Foundation/CPSet.ji;10;CPButton.jt;5459;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("Foundation/CPSet.j",NO);
objj_executeFile("CPButton.j",YES);
var _1=objj_allocateClassPair(CPButton,"CPRadio"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_radioGroup")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithFrame:radioGroup:"),function(_3,_4,_5,_6){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPRadio").super_class},"initWithFrame:",_5);
if(_3){
objj_msgSend(_3,"setRadioGroup:",_6);
objj_msgSend(_3,"setHighlightsBy:",CPContentsCellMask);
objj_msgSend(_3,"setShowsStateBy:",CPContentsCellMask);
objj_msgSend(_3,"setImagePosition:",CPImageLeft);
objj_msgSend(_3,"setAlignment:",CPLeftTextAlignment);
objj_msgSend(_3,"setBordered:",YES);
}
return _3;
}
}),new objj_method(sel_getUid("initWithFrame:"),function(_7,_8,_9){
with(_7){
return objj_msgSend(_7,"initWithFrame:radioGroup:",_9,objj_msgSend(CPRadioGroup,"new"));
}
}),new objj_method(sel_getUid("nextState"),function(_a,_b){
with(_a){
return CPOnState;
}
}),new objj_method(sel_getUid("setRadioGroup:"),function(_c,_d,_e){
with(_c){
if(_radioGroup===_e){
return;
}
objj_msgSend(_radioGroup,"_removeRadio:",_c);
_radioGroup=_e;
objj_msgSend(_radioGroup,"_addRadio:",_c);
}
}),new objj_method(sel_getUid("radioGroup"),function(_f,_10){
with(_f){
return _radioGroup;
}
}),new objj_method(sel_getUid("setObjectValue:"),function(_11,_12,_13){
with(_11){
objj_msgSendSuper({receiver:_11,super_class:objj_getClass("CPRadio").super_class},"setObjectValue:",_13);
if(objj_msgSend(_11,"state")===CPOnState){
objj_msgSend(_radioGroup,"_setSelectedRadio:",_11);
}
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("radioWithTitle:theme:"),function(_14,_15,_16,_17){
with(_14){
return objj_msgSend(_14,"buttonWithTitle:theme:",_16,_17);
}
}),new objj_method(sel_getUid("radioWithTitle:"),function(_18,_19,_1a){
with(_18){
return objj_msgSend(_18,"buttonWithTitle:",_1a);
}
}),new objj_method(sel_getUid("standardButtonWithTitle:"),function(_1b,_1c,_1d){
with(_1b){
var _1e=objj_msgSend(objj_msgSend(CPRadio,"alloc"),"init");
objj_msgSend(_1e,"setTitle:",_1d);
return _1e;
}
}),new objj_method(sel_getUid("themeClass"),function(_1f,_20){
with(_1f){
return "radio";
}
})]);
var _21="CPRadioRadioGroupKey";
var _1=objj_getClass("CPRadio");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPRadio\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_22,_23,_24){
with(_22){
_22=objj_msgSendSuper({receiver:_22,super_class:objj_getClass("CPRadio").super_class},"initWithCoder:",_24);
if(_22){
_radioGroup=objj_msgSend(_24,"decodeObjectForKey:",_21);
}
return _22;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_25,_26,_27){
with(_25){
objj_msgSendSuper({receiver:_25,super_class:objj_getClass("CPRadio").super_class},"encodeWithCoder:",_27);
objj_msgSend(_27,"encodeObject:forKey:",_radioGroup,_21);
}
})]);
var _1=objj_allocateClassPair(CPObject,"CPRadioGroup"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_radios"),new objj_ivar("_selectedRadio"),new objj_ivar("_target"),new objj_ivar("_action")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("target"),function(_28,_29){
with(_28){
return _target;
}
}),new objj_method(sel_getUid("setTarget:"),function(_2a,_2b,_2c){
with(_2a){
_target=_2c;
}
}),new objj_method(sel_getUid("action"),function(_2d,_2e){
with(_2d){
return _action;
}
}),new objj_method(sel_getUid("setAction:"),function(_2f,_30,_31){
with(_2f){
_action=_31;
}
}),new objj_method(sel_getUid("init"),function(_32,_33){
with(_32){
_32=objj_msgSendSuper({receiver:_32,super_class:objj_getClass("CPRadioGroup").super_class},"init");
if(_32){
_radios=objj_msgSend(CPSet,"set");
_selectedRadio=nil;
}
return _32;
}
}),new objj_method(sel_getUid("_addRadio:"),function(_34,_35,_36){
with(_34){
objj_msgSend(_radios,"addObject:",_36);
if(objj_msgSend(_36,"state")===CPOnState){
objj_msgSend(_34,"_setSelectedRadio:",_36);
}
}
}),new objj_method(sel_getUid("_removeRadio:"),function(_37,_38,_39){
with(_37){
if(_selectedRadio===_39){
_selectedRadio=nil;
}
objj_msgSend(_radios,"removeObject:",_39);
}
}),new objj_method(sel_getUid("_setSelectedRadio:"),function(_3a,_3b,_3c){
with(_3a){
if(_selectedRadio===_3c){
return;
}
objj_msgSend(_selectedRadio,"setState:",CPOffState);
_selectedRadio=_3c;
objj_msgSend(CPApp,"sendAction:to:from:",_action,_target,_3a);
}
}),new objj_method(sel_getUid("selectedRadio"),function(_3d,_3e){
with(_3d){
return _selectedRadio;
}
}),new objj_method(sel_getUid("radios"),function(_3f,_40){
with(_3f){
return objj_msgSend(_radios,"allObjects");
}
})]);
var _41="CPRadioGroupRadiosKey",_42="CPRadioGroupSelectedRadioKey";
var _1=objj_getClass("CPRadioGroup");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPRadioGroup\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_43,_44,_45){
with(_43){
_43=objj_msgSendSuper({receiver:_43,super_class:objj_getClass("CPRadioGroup").super_class},"init");
if(_43){
_radios=objj_msgSend(_45,"decodeObjectForKey:",_41);
_selectedRadio=objj_msgSend(_45,"decodeObjectForKey:",_42);
}
return _43;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_46,_47,_48){
with(_46){
objj_msgSend(_48,"encodeObject:forKey:",_radios,_41);
objj_msgSend(_48,"encodeObject:forKey:",_selectedRadio,_42);
}
})]);
p;13;CPResponder.jt;6011;@STATIC;1.0;I;21;Foundation/CPObject.jt;5966;
objj_executeFile("Foundation/CPObject.j",NO);
CPDeleteKeyCode=8;
CPTabKeyCode=9;
CPReturnKeyCode=13;
CPEscapeKeyCode=27;
CPSpaceKeyCode=32;
CPPageUpKeyCode=33;
CPPageDownKeyCode=34;
CPLeftArrowKeyCode=37;
CPUpArrowKeyCode=38;
CPRightArrowKeyCode=39;
CPDownArrowKeyCode=40;
var _1=objj_allocateClassPair(CPObject,"CPResponder"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_menu"),new objj_ivar("_nextResponder")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("acceptsFirstResponder"),function(_3,_4){
with(_3){
return NO;
}
}),new objj_method(sel_getUid("becomeFirstResponder"),function(_5,_6){
with(_5){
return YES;
}
}),new objj_method(sel_getUid("resignFirstResponder"),function(_7,_8){
with(_7){
return YES;
}
}),new objj_method(sel_getUid("setNextResponder:"),function(_9,_a,_b){
with(_9){
_nextResponder=_b;
}
}),new objj_method(sel_getUid("nextResponder"),function(_c,_d){
with(_c){
return _nextResponder;
}
}),new objj_method(sel_getUid("interpretKeyEvents:"),function(_e,_f,_10){
with(_e){
var _11=0,_12=objj_msgSend(_10,"count");
for(;_11<_12;++_11){
var _13=_10[_11];
switch(objj_msgSend(_13,"keyCode")){
case CPPageUpKeyCode:
objj_msgSend(_e,"doCommandBySelector:",sel_getUid("pageUp:"));
break;
case CPPageDownKeyCode:
objj_msgSend(_e,"doCommandBySelector:",sel_getUid("pageDown:"));
break;
case CPLeftArrowKeyCode:
objj_msgSend(_e,"doCommandBySelector:",sel_getUid("moveLeft:"));
break;
case CPRightArrowKeyCode:
objj_msgSend(_e,"doCommandBySelector:",sel_getUid("moveRight:"));
break;
case CPUpArrowKeyCode:
objj_msgSend(_e,"doCommandBySelector:",sel_getUid("moveUp:"));
break;
case CPDownArrowKeyCode:
objj_msgSend(_e,"doCommandBySelector:",sel_getUid("moveDown:"));
break;
case CPDeleteKeyCode:
objj_msgSend(_e,"doCommandBySelector:",sel_getUid("deleteBackward:"));
break;
case CPReturnKeyCode:
case 3:
objj_msgSend(_e,"doCommandBySelector:",sel_getUid("insertLineBreak:"));
break;
case CPEscapeKeyCode:
objj_msgSend(_e,"doCommandBySelector:",sel_getUid("cancel:"));
break;
case CPTabKeyCode:
var _14=objj_msgSend(_13,"modifierFlags")&CPShiftKeyMask;
if(!_14){
objj_msgSend(_e,"doCommandBySelector:",sel_getUid("insertTab:"));
}else{
objj_msgSend(_e,"doCommandBySelector:",sel_getUid("insertBackTab:"));
}
break;
default:
objj_msgSend(_e,"insertText:",objj_msgSend(_13,"characters"));
}
}
}
}),new objj_method(sel_getUid("mouseDown:"),function(_15,_16,_17){
with(_15){
objj_msgSend(_nextResponder,"performSelector:withObject:",_16,_17);
}
}),new objj_method(sel_getUid("mouseDragged:"),function(_18,_19,_1a){
with(_18){
objj_msgSend(_nextResponder,"performSelector:withObject:",_19,_1a);
}
}),new objj_method(sel_getUid("mouseUp:"),function(_1b,_1c,_1d){
with(_1b){
objj_msgSend(_nextResponder,"performSelector:withObject:",_1c,_1d);
}
}),new objj_method(sel_getUid("mouseMoved:"),function(_1e,_1f,_20){
with(_1e){
objj_msgSend(_nextResponder,"performSelector:withObject:",_1f,_20);
}
}),new objj_method(sel_getUid("mouseEntered:"),function(_21,_22,_23){
with(_21){
objj_msgSend(_nextResponder,"performSelector:withObject:",_22,_23);
}
}),new objj_method(sel_getUid("mouseExited:"),function(_24,_25,_26){
with(_24){
objj_msgSend(_nextResponder,"performSelector:withObject:",_25,_26);
}
}),new objj_method(sel_getUid("scrollWheel:"),function(_27,_28,_29){
with(_27){
objj_msgSend(_nextResponder,"performSelector:withObject:",_28,_29);
}
}),new objj_method(sel_getUid("keyDown:"),function(_2a,_2b,_2c){
with(_2a){
objj_msgSend(_nextResponder,"performSelector:withObject:",_2b,_2c);
}
}),new objj_method(sel_getUid("keyUp:"),function(_2d,_2e,_2f){
with(_2d){
objj_msgSend(_nextResponder,"performSelector:withObject:",_2e,_2f);
}
}),new objj_method(sel_getUid("performKeyEquivalent:"),function(_30,_31,_32){
with(_30){
return NO;
}
}),new objj_method(sel_getUid("insertLineBreak:"),function(_33,_34,_35){
with(_33){
objj_msgSend(_33,"insertNewline:",_35);
}
}),new objj_method(sel_getUid("insertNewline:"),function(_36,_37,_38){
with(_36){
objj_msgSend(objj_msgSend(_36,"nextResponder"),"insertNewline:",_38);
}
}),new objj_method(sel_getUid("cancel:"),function(_39,_3a,_3b){
with(_39){
}
}),new objj_method(sel_getUid("insertTab:"),function(_3c,_3d,_3e){
with(_3c){
}
}),new objj_method(sel_getUid("insertBackTab:"),function(_3f,_40,_41){
with(_3f){
}
}),new objj_method(sel_getUid("insertText:"),function(_42,_43,_44){
with(_42){
}
}),new objj_method(sel_getUid("doCommandBySelector:"),function(_45,_46,_47){
with(_45){
if(objj_msgSend(_45,"respondsToSelector:",_47)){
objj_msgSend(_45,"performSelector:",_47);
}else{
objj_msgSend(_nextResponder,"doCommandBySelector:",_47);
}
}
}),new objj_method(sel_getUid("tryToPerform:with:"),function(_48,_49,_4a,_4b){
with(_48){
if(objj_msgSend(_48,"respondsToSelector:",_4a)){
objj_msgSend(_48,"performSelector:withObject:",_4a,_4b);
return YES;
}
return objj_msgSend(_nextResponder,"tryToPerform:with:",_4a,_4b);
}
}),new objj_method(sel_getUid("setMenu:"),function(_4c,_4d,_4e){
with(_4c){
_menu=_4e;
}
}),new objj_method(sel_getUid("menu"),function(_4f,_50){
with(_4f){
return _menu;
}
}),new objj_method(sel_getUid("undoManager"),function(_51,_52){
with(_51){
return objj_msgSend(_nextResponder,"performSelector:",_52);
}
}),new objj_method(sel_getUid("noResponderFor:"),function(_53,_54,_55){
with(_53){
}
})]);
var _56="CPResponderNextResponderKey";
var _1=objj_getClass("CPResponder");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPResponder\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_57,_58,_59){
with(_57){
_57=objj_msgSendSuper({receiver:_57,super_class:objj_getClass("CPResponder").super_class},"init");
if(_57){
_nextResponder=objj_msgSend(_59,"decodeObjectForKey:",_56);
}
return _57;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_5a,_5b,_5c){
with(_5a){
if(_nextResponder!==nil){
objj_msgSend(_5c,"encodeConditionalObject:forKey:",_nextResponder,_56);
}
}
})]);
p;13;CPSavePanel.jt;2744;@STATIC;1.0;I;16;AppKit/CPPanel.jt;2704;
objj_executeFile("AppKit/CPPanel.j",NO);
var _1=objj_allocateClassPair(CPPanel,"CPSavePanel"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_URL"),new objj_ivar("_isExtensionHidden"),new objj_ivar("_canSelectHiddenExtension"),new objj_ivar("_allowsOtherFileTypes"),new objj_ivar("_canCreateDirectories"),new objj_ivar("_allowedFileTypes")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("isExtensionHidden"),function(_3,_4){
with(_3){
return _isExtensionHidden;
}
}),new objj_method(sel_getUid("setExtensionHidden:"),function(_5,_6,_7){
with(_5){
_isExtensionHidden=_7;
}
}),new objj_method(sel_getUid("canSelectHiddenExtension"),function(_8,_9){
with(_8){
return _canSelectHiddenExtension;
}
}),new objj_method(sel_getUid("setCanSelectHiddenExtension:"),function(_a,_b,_c){
with(_a){
_canSelectHiddenExtension=_c;
}
}),new objj_method(sel_getUid("allowsOtherFileTypes"),function(_d,_e){
with(_d){
return _allowsOtherFileTypes;
}
}),new objj_method(sel_getUid("setAllowsOtherFileTypes:"),function(_f,_10,_11){
with(_f){
_allowsOtherFileTypes=_11;
}
}),new objj_method(sel_getUid("canCreateDirectories"),function(_12,_13){
with(_12){
return _canCreateDirectories;
}
}),new objj_method(sel_getUid("setCanCreateDirectories:"),function(_14,_15,_16){
with(_14){
_canCreateDirectories=_16;
}
}),new objj_method(sel_getUid("allowedFileTypes"),function(_17,_18){
with(_17){
return _allowedFileTypes;
}
}),new objj_method(sel_getUid("setAllowedFileTypes:"),function(_19,_1a,_1b){
with(_19){
_allowedFileTypes=_1b;
}
}),new objj_method(sel_getUid("init"),function(_1c,_1d){
with(_1c){
if(_1c=objj_msgSendSuper({receiver:_1c,super_class:objj_getClass("CPSavePanel").super_class},"init")){
_canCreateDirectories=YES;
}
return _1c;
}
}),new objj_method(sel_getUid("runModal"),function(_1e,_1f){
with(_1e){
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
if(typeof window["cpSavePanel"]==="function"){
var _20=window.cpSavePanel({isExtensionHidden:_isExtensionHidden,canSelectHiddenExtension:_canSelectHiddenExtension,allowsOtherFileTypes:_allowsOtherFileTypes,canCreateDirectories:_canCreateDirectories,allowedFileTypes:_allowedFileTypes}),_21=_20.button;
_URL=_21?objj_msgSend(CPURL,"URLWithString:",_20.URL):nil;
}else{
var _22=window.prompt("Document Name:"),_21=_22!==null;
_URL=_21?objj_msgSend(objj_msgSend(_1e,"class"),"proposedFileURLWithDocumentName:",_22):nil;
}
return _21;
}
}),new objj_method(sel_getUid("URL"),function(_23,_24){
with(_23){
return _URL;
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("savePanel"),function(_25,_26){
with(_25){
return objj_msgSend(objj_msgSend(CPSavePanel,"alloc"),"init");
}
})]);
p;10;CPScreen.jt;421;@STATIC;1.0;I;21;Foundation/CPObject.jt;377;
objj_executeFile("Foundation/CPObject.j",NO);
var _1=objj_allocateClassPair(CPObject,"CPScreen"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("visibleFrame"),function(_3,_4){
with(_3){
return {origin:{x:window.screen.availLeft,y:window.screen.availTop},size:{width:window.screen.availWidth,height:window.screen.availHeight}};
}
})]);
p;12;CPScroller.jt;16331;@STATIC;1.0;i;11;CPControl.jt;16295;
objj_executeFile("CPControl.j",YES);
CPScrollerNoPart=0;
CPScrollerDecrementPage=1;
CPScrollerKnob=2;
CPScrollerIncrementPage=3;
CPScrollerDecrementLine=4;
CPScrollerIncrementLine=5;
CPScrollerKnobSlot=6;
CPScrollerIncrementArrow=0;
CPScrollerDecrementArrow=1;
CPNoScrollerParts=0;
CPOnlyScrollerArrows=1;
CPAllScrollerParts=2;
var _1=[CPScrollerKnobSlot,CPScrollerDecrementLine,CPScrollerIncrementLine,CPScrollerKnob],_2={},_3={};
_2[CPScrollerDecrementLine]="decrement-line";
_2[CPScrollerIncrementLine]="increment-line";
_2[CPScrollerKnobSlot]="knob-slot";
_2[CPScrollerKnob]="knob";
var _4=objj_allocateClassPair(CPControl,"CPScroller"),_5=_4.isa;
class_addIvars(_4,[new objj_ivar("_controlSize"),new objj_ivar("_usableParts"),new objj_ivar("_partRects"),new objj_ivar("_isVertical"),new objj_ivar("_knobProportion"),new objj_ivar("_hitPart"),new objj_ivar("_trackingPart"),new objj_ivar("_trackingFloatValue"),new objj_ivar("_trackingStartPoint")]);
objj_registerClassPair(_4);
class_addMethods(_4,[new objj_method(sel_getUid("isVertical"),function(_6,_7){
with(_6){
return _isVertical;
}
}),new objj_method(sel_getUid("initWithFrame:"),function(_8,_9,_a){
with(_8){
_8=objj_msgSendSuper({receiver:_8,super_class:objj_getClass("CPScroller").super_class},"initWithFrame:",_a);
if(_8){
_controlSize=CPRegularControlSize;
_partRects=[];
objj_msgSend(_8,"setFloatValue:",0);
objj_msgSend(_8,"setKnobProportion:",1);
_hitPart=CPScrollerNoPart;
objj_msgSend(_8,"_calculateIsVertical");
}
return _8;
}
}),new objj_method(sel_getUid("setControlSize:"),function(_b,_c,_d){
with(_b){
if(_controlSize==_d){
return;
}
_controlSize=_d;
objj_msgSend(_b,"setNeedsLayout");
objj_msgSend(_b,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("controlSize"),function(_e,_f){
with(_e){
return _controlSize;
}
}),new objj_method(sel_getUid("setObjectValue:"),function(_10,_11,_12){
with(_10){
objj_msgSendSuper({receiver:_10,super_class:objj_getClass("CPScroller").super_class},"setObjectValue:",MIN(1,MAX(0,+_12)));
}
}),new objj_method(sel_getUid("setKnobProportion:"),function(_13,_14,_15){
with(_13){
_knobProportion=MIN(1,MAX(0.0001,_15));
objj_msgSend(_13,"setNeedsDisplay:",YES);
objj_msgSend(_13,"setNeedsLayout");
}
}),new objj_method(sel_getUid("knobProportion"),function(_16,_17){
with(_16){
return _knobProportion;
}
}),new objj_method(sel_getUid("currentValueForThemeAttribute:"),function(_18,_19,_1a){
with(_18){
var _1b=_themeState;
if(_2[_hitPart]+"-color"!==_1a){
_1b&=~CPThemeStateHighlighted;
}
return objj_msgSend(_18,"valueForThemeAttribute:inState:",_1a,_1b);
}
}),new objj_method(sel_getUid("rectForPart:"),function(_1c,_1d,_1e){
with(_1c){
if(_1e==CPScrollerNoPart){
return {origin:{x:0,y:0},size:{width:0,height:0}};
}
return _partRects[_1e];
}
}),new objj_method(sel_getUid("testPart:"),function(_1f,_20,_21){
with(_1f){
_21=objj_msgSend(_1f,"convertPoint:fromView:",_21,nil);
if(CGRectContainsPoint(objj_msgSend(_1f,"rectForPart:",CPScrollerKnob),_21)){
return CPScrollerKnob;
}
if(CGRectContainsPoint(objj_msgSend(_1f,"rectForPart:",CPScrollerDecrementPage),_21)){
return CPScrollerDecrementPage;
}
if(CGRectContainsPoint(objj_msgSend(_1f,"rectForPart:",CPScrollerIncrementPage),_21)){
return CPScrollerIncrementPage;
}
if(CGRectContainsPoint(objj_msgSend(_1f,"rectForPart:",CPScrollerDecrementLine),_21)){
return CPScrollerDecrementLine;
}
if(CGRectContainsPoint(objj_msgSend(_1f,"rectForPart:",CPScrollerIncrementLine),_21)){
return CPScrollerIncrementLine;
}
if(CGRectContainsPoint(objj_msgSend(_1f,"rectForPart:",CPScrollerKnobSlot),_21)){
return CPScrollerKnobSlot;
}
return CPScrollerNoPart;
}
}),new objj_method(sel_getUid("checkSpaceForParts"),function(_22,_23){
with(_22){
var _24=objj_msgSend(_22,"bounds");
if(_knobProportion===1){
_usableParts=CPNoScrollerParts;
_partRects[CPScrollerDecrementPage]=CGRectMakeZero();
_partRects[CPScrollerKnob]=CGRectMakeZero();
_partRects[CPScrollerIncrementPage]=CGRectMakeZero();
_partRects[CPScrollerDecrementLine]=CGRectMakeZero();
_partRects[CPScrollerIncrementLine]=CGRectMakeZero();
_partRects[CPScrollerKnobSlot]=CGRectMakeCopy(_24);
return;
}
_usableParts=CPAllScrollerParts;
var _25=objj_msgSend(_22,"currentValueForThemeAttribute:","knob-inset"),_26=objj_msgSend(_22,"currentValueForThemeAttribute:","track-inset"),_27=(_24.size.width),_28=(_24.size.height);
if(objj_msgSend(_22,"isVertical")){
var _29=objj_msgSend(_22,"currentValueForThemeAttribute:","decrement-line-size"),_2a=objj_msgSend(_22,"currentValueForThemeAttribute:","increment-line-size"),_2b=_29.height+_26.top,_2c=_2a.height+_26.bottom,_2d=_28-_2b-_2c,_2e=objj_msgSend(_22,"currentValueForThemeAttribute:","minimum-knob-length"),_2f=_27-_25.left-_25.right,_30=MAX(_2e,(_2d*_knobProportion)),_31=_2b+(_2d-_30)*objj_msgSend(_22,"floatValue");
_partRects[CPScrollerDecrementPage]={origin:{x:0,y:_2b},size:{width:_27,height:_31-_2b}};
_partRects[CPScrollerKnob]={origin:{x:_25.left,y:_31},size:{width:_2f,height:_30}};
_partRects[CPScrollerIncrementPage]={origin:{x:0,y:_31+_30},size:{width:_27,height:_28-(_31+_30)-_2c}};
_partRects[CPScrollerKnobSlot]={origin:{x:_26.left,y:_2b},size:{width:_27-_26.left-_26.right,height:_2d}};
_partRects[CPScrollerDecrementLine]={origin:{x:0,y:0},size:{width:_29.width,height:_29.height}};
_partRects[CPScrollerIncrementLine]={origin:{x:0,y:_28-_2a.height},size:{width:_2a.width,height:_2a.height}};
if(_28<_30+_29.height+_2a.height+_26.top+_26.bottom){
_partRects[CPScrollerKnob]={origin:{x:0,y:0},size:{width:0,height:0}};
}
if(_28<_29.height+_2a.height-2){
_partRects[CPScrollerIncrementLine]={origin:{x:0,y:0},size:{width:0,height:0}};
_partRects[CPScrollerDecrementLine]={origin:{x:0,y:0},size:{width:0,height:0}};
_partRects[CPScrollerKnobSlot]={origin:{x:_26.left,y:0},size:{width:_27-_26.left-_26.right,height:_28}};
}
}else{
var _29=objj_msgSend(_22,"currentValueForThemeAttribute:","decrement-line-size"),_2a=objj_msgSend(_22,"currentValueForThemeAttribute:","increment-line-size"),_32=_29.width+_26.left,_33=_2a.width+_26.right;
slotWidth=_27-_32-_33,_2e=objj_msgSend(_22,"currentValueForThemeAttribute:","minimum-knob-length"),_2f=MAX(_2e,(slotWidth*_knobProportion)),_30=_28-_25.top-_25.bottom,_31=_32+(slotWidth-_2f)*objj_msgSend(_22,"floatValue");
_partRects[CPScrollerDecrementPage]={origin:{x:_32,y:0},size:{width:_31-_32,height:_28}};
_partRects[CPScrollerKnob]={origin:{x:_31,y:_25.top},size:{width:_2f,height:_30}};
_partRects[CPScrollerIncrementPage]={origin:{x:_31+_2f,y:0},size:{width:_27-(_31+_2f)-_33,height:_28}};
_partRects[CPScrollerKnobSlot]={origin:{x:_32,y:_26.top},size:{width:slotWidth,height:_28-_26.top-_26.bottom}};
_partRects[CPScrollerDecrementLine]={origin:{x:0,y:0},size:{width:_29.width,height:_29.height}};
_partRects[CPScrollerIncrementLine]={origin:{x:_27-_2a.width,y:0},size:{width:_2a.width,height:_2a.height}};
if(_27<_2f+_29.width+_2a.width+_26.left+_26.right){
_partRects[CPScrollerKnob]={origin:{x:0,y:0},size:{width:0,height:0}};
}
if(_27<_29.width+_2a.width-2){
_partRects[CPScrollerIncrementLine]={origin:{x:0,y:0},size:{width:0,height:0}};
_partRects[CPScrollerDecrementLine]={origin:{x:0,y:0},size:{width:0,height:0}};
_partRects[CPScrollerKnobSlot]={origin:{x:0,y:0},size:{width:_27,height:_2d}};
}
}
}
}),new objj_method(sel_getUid("usableParts"),function(_34,_35){
with(_34){
return _usableParts;
}
}),new objj_method(sel_getUid("drawArrow:highlight:"),function(_36,_37,_38,_39){
with(_36){
}
}),new objj_method(sel_getUid("drawKnob"),function(_3a,_3b){
with(_3a){
}
}),new objj_method(sel_getUid("drawKnobSlot"),function(_3c,_3d){
with(_3c){
}
}),new objj_method(sel_getUid("createViewForPart:"),function(_3e,_3f,_40){
with(_3e){
var _41=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",{origin:{x:0,y:0},size:{width:0,height:0}});
objj_msgSend(_41,"setHitTests:",NO);
return _41;
}
}),new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"),function(_42,_43,_44){
with(_42){
return _partRects[_44];
}
}),new objj_method(sel_getUid("createEphemeralSubviewNamed:"),function(_45,_46,_47){
with(_45){
var _48=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",{origin:{x:0,y:0},size:{width:0,height:0}});
objj_msgSend(_48,"setHitTests:",NO);
return _48;
}
}),new objj_method(sel_getUid("layoutSubviews"),function(_49,_4a){
with(_49){
objj_msgSend(_49,"checkSpaceForParts");
var _4b=0,_4c=_1.length;
for(;_4b<_4c;++_4b){
var _4d=_1[_4b];
if(_4b===0){
view=objj_msgSend(_49,"layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:",_4d,CPWindowBelow,_1[_4b+1]);
}else{
view=objj_msgSend(_49,"layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:",_4d,CPWindowAbove,_1[_4b-1]);
}
if(view){
objj_msgSend(view,"setBackgroundColor:",objj_msgSend(_49,"currentValueForThemeAttribute:",_2[_4d]+"-color"));
}
}
}
}),new objj_method(sel_getUid("drawParts"),function(_4e,_4f){
with(_4e){
objj_msgSend(_4e,"drawKnobSlot");
objj_msgSend(_4e,"drawKnob");
objj_msgSend(_4e,"drawArrow:highlight:",CPScrollerDecrementArrow,NO);
objj_msgSend(_4e,"drawArrow:highlight:",CPScrollerIncrementArrow,NO);
}
}),new objj_method(sel_getUid("hitPart"),function(_50,_51){
with(_50){
return _hitPart;
}
}),new objj_method(sel_getUid("trackKnob:"),function(_52,_53,_54){
with(_52){
var _55=objj_msgSend(_54,"type");
if(_55===CPLeftMouseUp){
_hitPart=CPScrollerNoPart;
return;
}
if(_55===CPLeftMouseDown){
_trackingFloatValue=objj_msgSend(_52,"floatValue");
_trackingStartPoint=objj_msgSend(_52,"convertPoint:fromView:",objj_msgSend(_54,"locationInWindow"),nil);
}else{
if(_55===CPLeftMouseDragged){
var _56=objj_msgSend(_52,"rectForPart:",CPScrollerKnob),_57=objj_msgSend(_52,"rectForPart:",CPScrollerKnobSlot),_58=!objj_msgSend(_52,"isVertical")?((_57.size.width)-(_56.size.width)):((_57.size.height)-(_56.size.height));
if(_58<=0){
objj_msgSend(_52,"setFloatValue:",0);
}else{
var _59=objj_msgSend(_52,"convertPoint:fromView:",objj_msgSend(_54,"locationInWindow"),nil);
delta=!objj_msgSend(_52,"isVertical")?_59.x-_trackingStartPoint.x:_59.y-_trackingStartPoint.y;
objj_msgSend(_52,"setFloatValue:",_trackingFloatValue+delta/_58);
}
}
}
objj_msgSend(CPApp,"setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:",_52,sel_getUid("trackKnob:"),CPLeftMouseDraggedMask|CPLeftMouseUpMask,nil,nil,YES);
objj_msgSend(_52,"sendAction:to:",objj_msgSend(_52,"action"),objj_msgSend(_52,"target"));
}
}),new objj_method(sel_getUid("trackScrollButtons:"),function(_5a,_5b,_5c){
with(_5a){
var _5d=objj_msgSend(_5c,"type");
if(_5d===CPLeftMouseUp){
objj_msgSend(_5a,"highlight:",NO);
objj_msgSend(CPEvent,"stopPeriodicEvents");
_hitPart=CPScrollerNoPart;
return;
}
if(_5d===CPLeftMouseDown){
_trackingPart=objj_msgSend(_5a,"hitPart");
_trackingStartPoint=objj_msgSend(_5a,"convertPoint:fromView:",objj_msgSend(_5c,"locationInWindow"),nil);
if(objj_msgSend(_5c,"modifierFlags")&CPAlternateKeyMask){
if(_trackingPart==CPScrollerDecrementLine){
_hitPart=CPScrollerDecrementPage;
}else{
if(_trackingPart==CPScrollerIncrementLine){
_hitPart=CPScrollerIncrementPage;
}else{
if(_trackingPart==CPScrollerDecrementPage||_trackingPart==CPScrollerIncrementPage){
var _5e=objj_msgSend(_5a,"rectForPart:",CPScrollerKnob),_5f=!objj_msgSend(_5a,"isVertical")?(_5e.size.width):(_5e.size.height),_60=objj_msgSend(_5a,"rectForPart:",CPScrollerKnobSlot),_61=(!objj_msgSend(_5a,"isVertical")?(_60.size.width):(_60.size.height))-_5f;
objj_msgSend(_5a,"setFloatValue:",((!objj_msgSend(_5a,"isVertical")?_trackingStartPoint.x-(_60.origin.x):_trackingStartPoint.y-(_60.origin.y))-_5f/2)/_61);
_hitPart=CPScrollerKnob;
objj_msgSend(_5a,"sendAction:to:",objj_msgSend(_5a,"action"),objj_msgSend(_5a,"target"));
return objj_msgSend(_5a,"trackKnob:",_5c);
}
}
}
}
objj_msgSend(_5a,"highlight:",YES);
objj_msgSend(_5a,"sendAction:to:",objj_msgSend(_5a,"action"),objj_msgSend(_5a,"target"));
objj_msgSend(CPEvent,"startPeriodicEventsAfterDelay:withPeriod:",0.5,0.04);
}else{
if(_5d===CPLeftMouseDragged){
_trackingStartPoint=objj_msgSend(_5a,"convertPoint:fromView:",objj_msgSend(_5c,"locationInWindow"),nil);
if(_trackingPart==CPScrollerDecrementPage||_trackingPart==CPScrollerIncrementPage){
var _62=objj_msgSend(_5a,"testPart:",objj_msgSend(_5c,"locationInWindow"));
if(_62==CPScrollerDecrementPage||_62==CPScrollerIncrementPage){
_trackingPart=_62;
_hitPart=_62;
}
}
objj_msgSend(_5a,"highlight:",CGRectContainsPoint(objj_msgSend(_5a,"rectForPart:",_trackingPart),_trackingStartPoint));
}else{
if(_5d==CPPeriodic&&CGRectContainsPoint(objj_msgSend(_5a,"rectForPart:",_trackingPart),_trackingStartPoint)){
objj_msgSend(_5a,"sendAction:to:",objj_msgSend(_5a,"action"),objj_msgSend(_5a,"target"));
}
}
}
objj_msgSend(CPApp,"setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:",_5a,sel_getUid("trackScrollButtons:"),CPPeriodicMask|CPLeftMouseDraggedMask|CPLeftMouseUpMask,nil,nil,YES);
}
}),new objj_method(sel_getUid("_calculateIsVertical"),function(_63,_64){
with(_63){
var _65=objj_msgSend(_63,"bounds"),_66=(_65.size.width),_67=(_65.size.height);
_isVertical=_66<_67?1:(_66>_67?0:-1);
if(_isVertical===1){
objj_msgSend(_63,"setThemeState:",CPThemeStateVertical);
}else{
if(_isVertical===0){
objj_msgSend(_63,"unsetThemeState:",CPThemeStateVertical);
}
}
}
}),new objj_method(sel_getUid("setFrameSize:"),function(_68,_69,_6a){
with(_68){
objj_msgSendSuper({receiver:_68,super_class:objj_getClass("CPScroller").super_class},"setFrameSize:",_6a);
objj_msgSend(_68,"checkSpaceForParts");
objj_msgSend(_68,"setNeedsLayout");
}
}),new objj_method(sel_getUid("mouseDown:"),function(_6b,_6c,_6d){
with(_6b){
if(!objj_msgSend(_6b,"isEnabled")){
return;
}
_hitPart=objj_msgSend(_6b,"testPart:",objj_msgSend(_6d,"locationInWindow"));
switch(_hitPart){
case CPScrollerKnob:
return objj_msgSend(_6b,"trackKnob:",_6d);
case CPScrollerDecrementLine:
case CPScrollerIncrementLine:
case CPScrollerDecrementPage:
case CPScrollerIncrementPage:
return objj_msgSend(_6b,"trackScrollButtons:",_6d);
}
}
})]);
class_addMethods(_5,[new objj_method(sel_getUid("themeClass"),function(_6e,_6f){
with(_6e){
return "scroller";
}
}),new objj_method(sel_getUid("themeAttributes"),function(_70,_71){
with(_70){
return objj_msgSend(CPDictionary,"dictionaryWithObjects:forKeys:",[objj_msgSend(CPNull,"null"),objj_msgSend(CPNull,"null"),objj_msgSend(CPNull,"null"),objj_msgSend(CPNull,"null"),{width:0,height:0},{width:0,height:0},{top:(0),right:(0),bottom:(0),left:(0)},{top:(0),right:(0),bottom:(0),left:(0)},{width:0,height:0}],["knob-slot-color","decrement-line-color","increment-line-color","knob-color","decrement-line-size","increment-line-size","track-inset","knob-inset","minimum-knob-length"]);
}
}),new objj_method(sel_getUid("scrollerWidth"),function(_72,_73){
with(_72){
return 15;
}
}),new objj_method(sel_getUid("scrollerWidthForControlSize:"),function(_74,_75,_76){
with(_74){
return 15;
}
})]);
var _77="CPScrollerControlSize",_78="CPScrollerKnobProportion";
var _4=objj_getClass("CPScroller");
if(!_4){
throw new SyntaxError("*** Could not find definition for class \"CPScroller\"");
}
var _5=_4.isa;
class_addMethods(_4,[new objj_method(sel_getUid("initWithCoder:"),function(_79,_7a,_7b){
with(_79){
if(_79=objj_msgSendSuper({receiver:_79,super_class:objj_getClass("CPScroller").super_class},"initWithCoder:",_7b)){
_controlSize=CPRegularControlSize;
if(objj_msgSend(_7b,"containsValueForKey:",_77)){
_controlSize=objj_msgSend(_7b,"decodeIntForKey:",_77);
}
_knobProportion=1;
if(objj_msgSend(_7b,"containsValueForKey:",_78)){
_knobProportion=objj_msgSend(_7b,"decodeFloatForKey:",_78);
}
_partRects=[];
_hitPart=CPScrollerNoPart;
objj_msgSend(_79,"_calculateIsVertical");
}
return _79;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_7c,_7d,_7e){
with(_7c){
objj_msgSendSuper({receiver:_7c,super_class:objj_getClass("CPScroller").super_class},"encodeWithCoder:",_7e);
objj_msgSend(_7e,"encodeInt:forKey:",_controlSize,_77);
objj_msgSend(_7e,"encodeFloat:forKey:",_knobProportion,_78);
}
})]);
var _4=objj_getClass("CPScroller");
if(!_4){
throw new SyntaxError("*** Could not find definition for class \"CPScroller\"");
}
var _5=_4.isa;
class_addMethods(_4,[new objj_method(sel_getUid("setFloatValue:knobProportion:"),function(_7f,_80,_81,_82){
with(_7f){
objj_msgSend(_7f,"setFloatValue:",_81);
objj_msgSend(_7f,"setKnobProportion:",_82);
}
})]);
p;14;CPScrollView.jt;18459;@STATIC;1.0;i;8;CPView.ji;12;CPClipView.ji;12;CPScroller.jt;18393;
objj_executeFile("CPView.j",YES);
objj_executeFile("CPClipView.j",YES);
objj_executeFile("CPScroller.j",YES);
var _1=objj_allocateClassPair(CPView,"CPScrollView"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_contentView"),new objj_ivar("_headerClipView"),new objj_ivar("_cornerView"),new objj_ivar("_hasVerticalScroller"),new objj_ivar("_hasHorizontalScroller"),new objj_ivar("_autohidesScrollers"),new objj_ivar("_verticalScroller"),new objj_ivar("_horizontalScroller"),new objj_ivar("_recursionCount"),new objj_ivar("_verticalLineScroll"),new objj_ivar("_verticalPageScroll"),new objj_ivar("_horizontalLineScroll"),new objj_ivar("_horizontalPageScroll")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithFrame:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPScrollView").super_class},"initWithFrame:",_5);
if(_3){
_verticalLineScroll=10;
_verticalPageScroll=10;
_horizontalLineScroll=10;
_horizontalPageScroll=10;
_contentView=objj_msgSend(objj_msgSend(CPClipView,"alloc"),"initWithFrame:",objj_msgSend(_3,"bounds"));
objj_msgSend(_3,"addSubview:",_contentView);
_headerClipView=objj_msgSend(objj_msgSend(CPClipView,"alloc"),"init");
objj_msgSend(_3,"addSubview:",_headerClipView);
objj_msgSend(_3,"setHasVerticalScroller:",YES);
objj_msgSend(_3,"setHasHorizontalScroller:",YES);
}
return _3;
}
}),new objj_method(sel_getUid("contentSize"),function(_6,_7){
with(_6){
return objj_msgSend(_contentView,"frame").size;
}
}),new objj_method(sel_getUid("documentView"),function(_8,_9){
with(_8){
return objj_msgSend(_contentView,"documentView");
}
}),new objj_method(sel_getUid("setContentView:"),function(_a,_b,_c){
with(_a){
if(_contentView!==_c||!_c){
return;
}
var _d=objj_msgSend(_c,"documentView");
if(_d){
objj_msgSend(_d,"removeFromSuperview");
}
objj_msgSend(_contentView,"removeFromSuperview");
_contentView=_c;
objj_msgSend(_contentView,"setDocumentView:",_d);
objj_msgSend(_a,"addSubview:",_contentView);
objj_msgSend(_a,"reflectScrolledClipView:",_contentView);
}
}),new objj_method(sel_getUid("contentView"),function(_e,_f){
with(_e){
return _contentView;
}
}),new objj_method(sel_getUid("setDocumentView:"),function(_10,_11,_12){
with(_10){
objj_msgSend(_contentView,"setDocumentView:",_12);
objj_msgSend(_10,"_updateCornerAndHeaderView");
objj_msgSend(_10,"reflectScrolledClipView:",_contentView);
}
}),new objj_method(sel_getUid("reflectScrolledClipView:"),function(_13,_14,_15){
with(_13){
if(_contentView!==_15){
return;
}
if(_recursionCount>5){
return;
}
++_recursionCount;
var _16=objj_msgSend(_13,"documentView");
if(!_16){
if(_autohidesScrollers){
objj_msgSend(_verticalScroller,"setHidden:",YES);
objj_msgSend(_horizontalScroller,"setHidden:",YES);
}else{
}
objj_msgSend(_contentView,"setFrame:",objj_msgSend(_13,"bounds"));
objj_msgSend(_headerClipView,"setFrame:",{origin:{x:0,y:0},size:{width:0,height:0}});
--_recursionCount;
return;
}
var _17=objj_msgSend(_16,"frame"),_18=objj_msgSend(_13,"bounds"),_19=objj_msgSend(_13,"_headerClipViewFrame"),_1a=(_19.size.height);
_18.origin.y+=_1a;
_18.size.height-=_1a;
var _1b={width:(_17.size.width)-(_18.size.width),height:(_17.size.height)-(_18.size.height)},_1c=(objj_msgSend(_verticalScroller,"frame").size.width),_1d=(objj_msgSend(_horizontalScroller,"frame").size.height),_1e=_1b.height>0,_1f=_1b.width>0,_20=_hasVerticalScroller&&(!_autohidesScrollers||_1e),_21=_hasHorizontalScroller&&(!_autohidesScrollers||_1f);
if(_20){
_1b.width+=_1c;
_1f=_1b.width>0;
_21=_hasHorizontalScroller&&(!_autohidesScrollers||_1f);
}
if(_21){
_1b.height+=_1d;
_1e=_1b.height>0;
_20=_hasVerticalScroller&&(!_autohidesScrollers||_1e);
}
objj_msgSend(_verticalScroller,"setHidden:",!_20);
objj_msgSend(_verticalScroller,"setEnabled:",_1e);
objj_msgSend(_horizontalScroller,"setHidden:",!_21);
objj_msgSend(_horizontalScroller,"setEnabled:",_1f);
if(_20){
_18.size.width-=_1c;
}
if(_21){
_18.size.height-=_1d;
}
var _22=objj_msgSend(_contentView,"bounds").origin,_23=!objj_msgSend(_verticalScroller,"isHidden"),_24=!objj_msgSend(_horizontalScroller,"isHidden");
if(_20){
var _25=MAX((objj_msgSend(_13,"_cornerViewFrame").size.height),_1a),_26=(objj_msgSend(_13,"bounds").size.height)-_25;
if(_21){
_26-=_1d;
}
objj_msgSend(_verticalScroller,"setFloatValue:",(_1b.height<=0)?0:_22.y/_1b.height);
objj_msgSend(_verticalScroller,"setKnobProportion:",(_18.size.height)/(_17.size.height));
objj_msgSend(_verticalScroller,"setFrame:",{origin:{x:(_18.origin.x+_18.size.width),y:_25},size:{width:_1c,height:_26}});
}else{
if(_23){
objj_msgSend(_verticalScroller,"setFloatValue:",0);
objj_msgSend(_verticalScroller,"setKnobProportion:",1);
}
}
if(_21){
objj_msgSend(_horizontalScroller,"setFloatValue:",(_1b.width<=0)?0:_22.x/_1b.width);
objj_msgSend(_horizontalScroller,"setKnobProportion:",(_18.size.width)/(_17.size.width));
objj_msgSend(_horizontalScroller,"setFrame:",{origin:{x:0,y:(_18.origin.y+_18.size.height)},size:{width:(_18.size.width),height:_1d}});
}else{
if(_24){
objj_msgSend(_horizontalScroller,"setFloatValue:",0);
objj_msgSend(_horizontalScroller,"setKnobProportion:",1);
}
}
objj_msgSend(_contentView,"setFrame:",_18);
objj_msgSend(_headerClipView,"setFrame:",_19);
objj_msgSend(_cornerView,"setFrame:",objj_msgSend(_13,"_cornerViewFrame"));
--_recursionCount;
}
}),new objj_method(sel_getUid("setHorizontalScroller:"),function(_27,_28,_29){
with(_27){
if(_horizontalScroller===_29){
return;
}
objj_msgSend(_horizontalScroller,"removeFromSuperview");
objj_msgSend(_horizontalScroller,"setTarget:",nil);
objj_msgSend(_horizontalScroller,"setAction:",nil);
_horizontalScroller=_29;
objj_msgSend(_horizontalScroller,"setTarget:",_27);
objj_msgSend(_horizontalScroller,"setAction:",sel_getUid("_horizontalScrollerDidScroll:"));
objj_msgSend(_27,"addSubview:",_horizontalScroller);
objj_msgSend(_27,"reflectScrolledClipView:",_contentView);
}
}),new objj_method(sel_getUid("horizontalScroller"),function(_2a,_2b){
with(_2a){
return _horizontalScroller;
}
}),new objj_method(sel_getUid("setHasHorizontalScroller:"),function(_2c,_2d,_2e){
with(_2c){
if(_hasHorizontalScroller===_2e){
return;
}
_hasHorizontalScroller=_2e;
if(_hasHorizontalScroller&&!_horizontalScroller){
objj_msgSend(_2c,"setHorizontalScroller:",objj_msgSend(objj_msgSend(CPScroller,"alloc"),"initWithFrame:",CGRectMake(0,0,MAX((objj_msgSend(_2c,"bounds").size.width),objj_msgSend(CPScroller,"scrollerWidth")+1),objj_msgSend(CPScroller,"scrollerWidth"))));
objj_msgSend(objj_msgSend(_2c,"horizontalScroller"),"setFrameSize:",CGSizeMake((objj_msgSend(_2c,"bounds").size.width),objj_msgSend(CPScroller,"scrollerWidth")));
}
objj_msgSend(_2c,"reflectScrolledClipView:",_contentView);
}
}),new objj_method(sel_getUid("hasHorizontalScroller"),function(_2f,_30){
with(_2f){
return _hasHorizontalScroller;
}
}),new objj_method(sel_getUid("setVerticalScroller:"),function(_31,_32,_33){
with(_31){
if(_verticalScroller===_33){
return;
}
objj_msgSend(_verticalScroller,"removeFromSuperview");
objj_msgSend(_verticalScroller,"setTarget:",nil);
objj_msgSend(_verticalScroller,"setAction:",nil);
_verticalScroller=_33;
objj_msgSend(_verticalScroller,"setTarget:",_31);
objj_msgSend(_verticalScroller,"setAction:",sel_getUid("_verticalScrollerDidScroll:"));
objj_msgSend(_31,"addSubview:",_verticalScroller);
objj_msgSend(_31,"reflectScrolledClipView:",_contentView);
}
}),new objj_method(sel_getUid("verticalScroller"),function(_34,_35){
with(_34){
return _verticalScroller;
}
}),new objj_method(sel_getUid("setHasVerticalScroller:"),function(_36,_37,_38){
with(_36){
if(_hasVerticalScroller===_38){
return;
}
_hasVerticalScroller=_38;
if(_hasVerticalScroller&&!_verticalScroller){
objj_msgSend(_36,"setVerticalScroller:",objj_msgSend(objj_msgSend(CPScroller,"alloc"),"initWithFrame:",{origin:{x:0,y:0},size:{width:objj_msgSend(CPScroller,"scrollerWidth"),height:MAX((objj_msgSend(_36,"bounds").size.height),objj_msgSend(CPScroller,"scrollerWidth")+1)}}));
objj_msgSend(objj_msgSend(_36,"verticalScroller"),"setFrameSize:",CGSizeMake(objj_msgSend(CPScroller,"scrollerWidth"),(objj_msgSend(_36,"bounds").size.height)));
}
objj_msgSend(_36,"reflectScrolledClipView:",_contentView);
}
}),new objj_method(sel_getUid("hasVerticalScroller"),function(_39,_3a){
with(_39){
return _hasVerticalScroller;
}
}),new objj_method(sel_getUid("setAutohidesScrollers:"),function(_3b,_3c,_3d){
with(_3b){
if(_autohidesScrollers==_3d){
return;
}
_autohidesScrollers=_3d;
objj_msgSend(_3b,"reflectScrolledClipView:",_contentView);
}
}),new objj_method(sel_getUid("autohidesScrollers"),function(_3e,_3f){
with(_3e){
return _autohidesScrollers;
}
}),new objj_method(sel_getUid("_updateCornerAndHeaderView"),function(_40,_41){
with(_40){
var _42=objj_msgSend(_40,"documentView"),_43=objj_msgSend(_40,"_headerView"),_44=objj_msgSend(_42,"respondsToSelector:",sel_getUid("headerView"))?objj_msgSend(_42,"headerView"):nil;
if(_43!==_44){
objj_msgSend(_43,"removeFromSuperview");
objj_msgSend(_headerClipView,"setDocumentView:",_44);
}
var _45=objj_msgSend(_42,"respondsToSelector:",sel_getUid("cornerView"))?objj_msgSend(_42,"cornerView"):nil;
if(_cornerView!==_45){
objj_msgSend(_cornerView,"removeFromSuperview");
_cornerView=_45;
if(_cornerView){
objj_msgSend(_40,"addSubview:",_cornerView);
}
}
objj_msgSend(_40,"reflectScrolledClipView:",_contentView);
}
}),new objj_method(sel_getUid("_headerView"),function(_46,_47){
with(_46){
var _48=objj_msgSend(_headerClipView,"subviews");
return objj_msgSend(_48,"count")?_48[0]:nil;
}
}),new objj_method(sel_getUid("_cornerViewFrame"),function(_49,_4a){
with(_49){
if(!_cornerView){
return {origin:{x:0,y:0},size:{width:0,height:0}};
}
var _4b=objj_msgSend(_49,"bounds"),_4c=objj_msgSend(_cornerView,"frame");
_4c.origin.x=(_4b.origin.x+_4b.size.width)-(_4c.size.width);
_4c.origin.y=0;
return _4c;
}
}),new objj_method(sel_getUid("_headerClipViewFrame"),function(_4d,_4e){
with(_4d){
var _4f=objj_msgSend(_4d,"_headerView");
if(!_4f){
return {origin:{x:0,y:0},size:{width:0,height:0}};
}
var _50=objj_msgSend(_4d,"bounds");
_50.size.height=(objj_msgSend(_4f,"frame").size.height);
_50.size.width-=(objj_msgSend(_4d,"_cornerViewFrame").size.width);
return _50;
}
}),new objj_method(sel_getUid("_verticalScrollerDidScroll:"),function(_51,_52,_53){
with(_51){
var _54=objj_msgSend(_53,"floatValue"),_55=objj_msgSend(objj_msgSend(_contentView,"documentView"),"frame");
contentBounds=objj_msgSend(_contentView,"bounds");
switch(objj_msgSend(_verticalScroller,"hitPart")){
case CPScrollerDecrementLine:
contentBounds.origin.y-=_verticalLineScroll;
break;
case CPScrollerIncrementLine:
contentBounds.origin.y+=_verticalLineScroll;
break;
case CPScrollerDecrementPage:
contentBounds.origin.y-=(contentBounds.size.height)-_verticalPageScroll;
break;
case CPScrollerIncrementPage:
contentBounds.origin.y+=(contentBounds.size.height)-_verticalPageScroll;
break;
case CPScrollerKnobSlot:
case CPScrollerKnob:
default:
contentBounds.origin.y=ROUND(_54*((_55.size.height)-(contentBounds.size.height)));
}
objj_msgSend(_contentView,"scrollToPoint:",contentBounds.origin);
}
}),new objj_method(sel_getUid("_horizontalScrollerDidScroll:"),function(_56,_57,_58){
with(_56){
var _59=objj_msgSend(_58,"floatValue"),_5a=objj_msgSend(objj_msgSend(_56,"documentView"),"frame"),_5b=objj_msgSend(_contentView,"bounds");
switch(objj_msgSend(_horizontalScroller,"hitPart")){
case CPScrollerDecrementLine:
_5b.origin.x-=_horizontalLineScroll;
break;
case CPScrollerIncrementLine:
_5b.origin.x+=_horizontalLineScroll;
break;
case CPScrollerDecrementPage:
_5b.origin.x-=(_5b.size.width)-_horizontalPageScroll;
break;
case CPScrollerIncrementPage:
_5b.origin.x+=(_5b.size.width)-_horizontalPageScroll;
break;
case CPScrollerKnobSlot:
case CPScrollerKnob:
default:
_5b.origin.x=ROUND(_59*((_5a.size.width)-(_5b.size.width)));
}
objj_msgSend(_contentView,"scrollToPoint:",_5b.origin);
objj_msgSend(_headerClipView,"scrollToPoint:",CGPointMake(_5b.origin.x,0));
}
}),new objj_method(sel_getUid("tile"),function(_5c,_5d){
with(_5c){
}
}),new objj_method(sel_getUid("resizeSubviewsWithOldSize:"),function(_5e,_5f,_60){
with(_5e){
objj_msgSend(_5e,"reflectScrolledClipView:",_contentView);
}
}),new objj_method(sel_getUid("setLineScroll:"),function(_61,_62,_63){
with(_61){
objj_msgSend(_61,"setHorizonalLineScroll:",_63);
objj_msgSend(_61,"setVerticalLineScroll:",_63);
}
}),new objj_method(sel_getUid("lineScroll"),function(_64,_65){
with(_64){
return objj_msgSend(_64,"horizontalLineScroll");
}
}),new objj_method(sel_getUid("setHorizontalLineScroll:"),function(_66,_67,_68){
with(_66){
_horizontalLineScroll=_68;
}
}),new objj_method(sel_getUid("horizontalLineScroll"),function(_69,_6a){
with(_69){
return _horizontalLineScroll;
}
}),new objj_method(sel_getUid("setVerticalLineScroll:"),function(_6b,_6c,_6d){
with(_6b){
_verticalLineScroll=_6d;
}
}),new objj_method(sel_getUid("verticalLineScroll"),function(_6e,_6f){
with(_6e){
return _verticalLineScroll;
}
}),new objj_method(sel_getUid("setPageScroll:"),function(_70,_71,_72){
with(_70){
objj_msgSend(_70,"setHorizontalPageScroll:",_72);
objj_msgSend(_70,"setVerticalPageScroll:",_72);
}
}),new objj_method(sel_getUid("pageScroll"),function(_73,_74){
with(_73){
return objj_msgSend(_73,"horizontalPageScroll");
}
}),new objj_method(sel_getUid("setHorizontalPageScroll:"),function(_75,_76,_77){
with(_75){
_horizontalPageScroll=_77;
}
}),new objj_method(sel_getUid("horizontalPageScroll"),function(_78,_79){
with(_78){
return _horizontalPageScroll;
}
}),new objj_method(sel_getUid("setVerticalPageScroll:"),function(_7a,_7b,_7c){
with(_7a){
_verticalPageScroll=_7c;
}
}),new objj_method(sel_getUid("verticalPageScroll"),function(_7d,_7e){
with(_7d){
return _verticalPageScroll;
}
}),new objj_method(sel_getUid("scrollWheel:"),function(_7f,_80,_81){
with(_7f){
var _82=objj_msgSend(objj_msgSend(_7f,"documentView"),"frame"),_83=objj_msgSend(_contentView,"bounds");
_83.origin.x=ROUND(_83.origin.x+objj_msgSend(_81,"deltaX")*_horizontalLineScroll);
_83.origin.y=ROUND(_83.origin.y+objj_msgSend(_81,"deltaY")*_verticalLineScroll);
objj_msgSend(_contentView,"scrollToPoint:",_83.origin);
objj_msgSend(_headerClipView,"scrollToPoint:",CGPointMake(_83.origin.x,0));
}
}),new objj_method(sel_getUid("keyDown:"),function(_84,_85,_86){
with(_84){
objj_msgSend(_84,"interpretKeyEvents:",[_86]);
}
}),new objj_method(sel_getUid("pageUp:"),function(_87,_88,_89){
with(_87){
var _8a=objj_msgSend(_contentView,"bounds");
objj_msgSend(_87,"moveByOffset:",CGSizeMake(0,-((_8a.size.height)-_verticalPageScroll)));
}
}),new objj_method(sel_getUid("pageDown:"),function(_8b,_8c,_8d){
with(_8b){
var _8e=objj_msgSend(_contentView,"bounds");
objj_msgSend(_8b,"moveByOffset:",CGSizeMake(0,(_8e.size.height)-_verticalPageScroll));
}
}),new objj_method(sel_getUid("moveLeft:"),function(_8f,_90,_91){
with(_8f){
objj_msgSend(_8f,"moveByOffset:",CGSizeMake(-_horizontalLineScroll,0));
}
}),new objj_method(sel_getUid("moveRight:"),function(_92,_93,_94){
with(_92){
objj_msgSend(_92,"moveByOffset:",CGSizeMake(_horizontalLineScroll,0));
}
}),new objj_method(sel_getUid("moveUp:"),function(_95,_96,_97){
with(_95){
objj_msgSend(_95,"moveByOffset:",CGSizeMake(0,-_verticalLineScroll));
}
}),new objj_method(sel_getUid("moveDown:"),function(_98,_99,_9a){
with(_98){
objj_msgSend(_98,"moveByOffset:",CGSizeMake(0,_verticalLineScroll));
}
}),new objj_method(sel_getUid("moveByOffset:"),function(_9b,_9c,_9d){
with(_9b){
var _9e=objj_msgSend(objj_msgSend(_9b,"documentView"),"frame"),_9f=objj_msgSend(_contentView,"bounds");
_9f.origin.x+=_9d.width;
_9f.origin.y+=_9d.height;
objj_msgSend(_contentView,"scrollToPoint:",_9f.origin);
objj_msgSend(_headerClipView,"scrollToPoint:",CGPointMake(_9f.origin,0));
}
})]);
var _a0="CPScrollViewContentView",_a1="CPScrollViewHeaderClipViewKey",_a2="CPScrollViewVLineScroll",_a3="CPScrollViewHLineScroll",_a4="CPScrollViewVPageScroll",_a5="CPScrollViewHPageScroll",_a6="CPScrollViewHasVScroller",_a7="CPScrollViewHasHScroller",_a8="CPScrollViewVScroller",_a9="CPScrollViewHScroller",_aa="CPScrollViewAutohidesScroller",_ab="CPScrollViewCornerViewKey";
var _1=objj_getClass("CPScrollView");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPScrollView\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_ac,_ad,_ae){
with(_ac){
if(_ac=objj_msgSendSuper({receiver:_ac,super_class:objj_getClass("CPScrollView").super_class},"initWithCoder:",_ae)){
_verticalLineScroll=objj_msgSend(_ae,"decodeFloatForKey:",_a2);
_verticalPageScroll=objj_msgSend(_ae,"decodeFloatForKey:",_a4);
_horizontalLineScroll=objj_msgSend(_ae,"decodeFloatForKey:",_a3);
_horizontalPageScroll=objj_msgSend(_ae,"decodeFloatForKey:",_a5);
_contentView=objj_msgSend(_ae,"decodeObjectForKey:",_a0);
_headerClipView=objj_msgSend(_ae,"decodeObjectForKey:",_a1);
_verticalScroller=objj_msgSend(_ae,"decodeObjectForKey:",_a8);
_horizontalScroller=objj_msgSend(_ae,"decodeObjectForKey:",_a9);
_hasVerticalScroller=objj_msgSend(_ae,"decodeBoolForKey:",_a6);
_hasHorizontalScroller=objj_msgSend(_ae,"decodeBoolForKey:",_a7);
_autohidesScrollers=objj_msgSend(_ae,"decodeBoolForKey:",_aa);
_cornerView=objj_msgSend(_ae,"decodeObjectForKey:",_ab);
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"performSelector:target:argument:order:modes:",sel_getUid("reflectScrolledClipView:"),_ac,_contentView,0,[CPDefaultRunLoopMode]);
}
return _ac;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_af,_b0,_b1){
with(_af){
objj_msgSendSuper({receiver:_af,super_class:objj_getClass("CPScrollView").super_class},"encodeWithCoder:",_b1);
objj_msgSend(_b1,"encodeObject:forKey:",_contentView,_a0);
objj_msgSend(_b1,"encodeObject:forKey:",_headerClipView,_a1);
objj_msgSend(_b1,"encodeObject:forKey:",_verticalScroller,_a8);
objj_msgSend(_b1,"encodeObject:forKey:",_horizontalScroller,_a9);
objj_msgSend(_b1,"encodeFloat:forKey:",_verticalLineScroll,_a2);
objj_msgSend(_b1,"encodeFloat:forKey:",_verticalPageScroll,_a4);
objj_msgSend(_b1,"encodeFloat:forKey:",_horizontalLineScroll,_a3);
objj_msgSend(_b1,"encodeFloat:forKey:",_horizontalPageScroll,_a5);
objj_msgSend(_b1,"encodeBool:forKey:",_hasVerticalScroller,_a6);
objj_msgSend(_b1,"encodeBool:forKey:",_hasHorizontalScroller,_a7);
objj_msgSend(_b1,"encodeBool:forKey:",_autohidesScrollers,_aa);
objj_msgSend(_b1,"encodeObject:forKey:",_cornerView,_ab);
}
})]);
p;15;CPSearchField.jt;18810;@STATIC;1.0;i;13;CPTextField.jt;18772;
objj_executeFile("CPTextField.j",YES);
CPSearchFieldRecentsTitleMenuItemTag=1000;
CPSearchFieldRecentsMenuItemTag=1001;
CPSearchFieldClearRecentsMenuItemTag=1002;
CPSearchFieldNoRecentsMenuItemTag=1003;
var _1=nil,_2=nil,_3=nil,_4=nil;
var _5=objj_allocateClassPair(CPTextField,"CPSearchField"),_6=_5.isa;
class_addIvars(_5,[new objj_ivar("_searchButton"),new objj_ivar("_cancelButton"),new objj_ivar("_searchMenuTemplate"),new objj_ivar("_searchMenu"),new objj_ivar("_recentsAutosaveName"),new objj_ivar("_recentSearches"),new objj_ivar("_maximumRecents"),new objj_ivar("_sendsWholeSearchString"),new objj_ivar("_sendsSearchStringImmediately"),new objj_ivar("_partialStringTimer")]);
objj_registerClassPair(_5);
class_addMethods(_5,[new objj_method(sel_getUid("initWithFrame:"),function(_7,_8,_9){
with(_7){
if(_7=objj_msgSendSuper({receiver:_7,super_class:objj_getClass("CPSearchField").super_class},"initWithFrame:",_9)){
_recentSearches=objj_msgSend(CPArray,"array");
_maximumRecents=10;
_sendsWholeSearchString=NO;
_sendsSearchStringImmediately=NO;
_recentsAutosaveName=nil;
objj_msgSend(_7,"_initWithFrame:",_9);
_cancelButton._DOMElement.style.cursor="default";
_searchButton._DOMElement.style.cursor="default";
}
return _7;
}
}),new objj_method(sel_getUid("_initWithFrame:"),function(_a,_b,_c){
with(_a){
objj_msgSend(_a,"setBezeled:",YES);
objj_msgSend(_a,"setBezelStyle:",CPTextFieldRoundedBezel);
objj_msgSend(_a,"setBordered:",YES);
objj_msgSend(_a,"setEditable:",YES);
objj_msgSend(_a,"setDelegate:",_a);
_cancelButton=objj_msgSend(objj_msgSend(CPButton,"alloc"),"initWithFrame:",CPMakeRect(_c.size.width-27,(_c.size.height-22)/2,22,22));
objj_msgSend(_a,"resetCancelButton");
objj_msgSend(_cancelButton,"setHidden:",YES);
objj_msgSend(_cancelButton,"setAutoresizingMask:",CPViewMinXMargin);
objj_msgSend(_a,"addSubview:",_cancelButton);
_searchButton=objj_msgSend(objj_msgSend(CPButton,"alloc"),"initWithFrame:",CPMakeRect(5,(_c.size.height-25)/2,25,25));
objj_msgSend(_a,"resetSearchButton");
objj_msgSend(_a,"addSubview:",_searchButton);
}
}),new objj_method(sel_getUid("setSearchButton:"),function(_d,_e,_f){
with(_d){
_searchButton=_f;
}
}),new objj_method(sel_getUid("searchButton"),function(_10,_11){
with(_10){
return _searchButton;
}
}),new objj_method(sel_getUid("resetSearchButton"),function(_12,_13){
with(_12){
var _14,_15,_16,_17=objj_msgSend(_12,"searchButton");
if(_searchMenuTemplate===nil){
_14=_1;
_15=sel_getUid("_sendAction:");
_16=_12;
}else{
_14=_2;
_15=sel_getUid("_showMenu:");
_16=_12;
}
objj_msgSend(_17,"setBordered:",NO);
objj_msgSend(_17,"setImageScaling:",CPScaleToFit);
objj_msgSend(_17,"setImage:",_14);
objj_msgSend(_17,"setAutoresizingMask:",CPViewMaxXMargin);
objj_msgSend(_17,"setTarget:",_16);
objj_msgSend(_17,"setAction:",_15);
}
}),new objj_method(sel_getUid("setCancelButton:"),function(_18,_19,_1a){
with(_18){
_cancelButton=_1a;
}
}),new objj_method(sel_getUid("cancelButton"),function(_1b,_1c){
with(_1b){
return _cancelButton;
}
}),new objj_method(sel_getUid("resetCancelButton"),function(_1d,_1e){
with(_1d){
var _1f=objj_msgSend(_1d,"cancelButton");
objj_msgSend(_1f,"setBordered:",NO);
objj_msgSend(_1f,"setImageScaling:",CPScaleToFit);
objj_msgSend(_1f,"setImage:",_3);
objj_msgSend(_1f,"setAlternateImage:",_4);
objj_msgSend(_1f,"setAutoresizingMask:",CPViewMinXMargin);
objj_msgSend(_1f,"setTarget:",_1d);
objj_msgSend(_1f,"setAction:",sel_getUid("_searchFieldCancel:"));
}
}),new objj_method(sel_getUid("searchTextRectForBounds:"),function(_20,_21,_22){
with(_20){
var _23=0,_24=_22.size.width;
if(_searchButton){
var _25=objj_msgSend(_searchButton,"frame");
_23=_25.origin.x+_25.size.width;
}
if(_cancelButton){
var _26=objj_msgSend(_cancelButton,"frame");
_24=_26.origin.x-_23;
}
return CPMakeRect(_23,_22.origin.y,_24,_22.size.height);
}
}),new objj_method(sel_getUid("searchButtonRectForBounds:"),function(_27,_28,_29){
with(_27){
return objj_msgSend(_searchButton,"frame");
}
}),new objj_method(sel_getUid("cancelButtonRectForBounds:"),function(_2a,_2b,_2c){
with(_2a){
return objj_msgSend(_cancelButton,"frame");
}
}),new objj_method(sel_getUid("searchMenuTemplate"),function(_2d,_2e){
with(_2d){
return _searchMenuTemplate;
}
}),new objj_method(sel_getUid("setSearchMenuTemplate:"),function(_2f,_30,_31){
with(_2f){
_searchMenuTemplate=_31;
objj_msgSend(_2f,"resetSearchButton");
objj_msgSend(_2f,"_loadRecentSearchList");
objj_msgSend(_2f,"_updateSearchMenu");
}
}),new objj_method(sel_getUid("sendsWholeSearchString"),function(_32,_33){
with(_32){
return _sendsWholeSearchString;
}
}),new objj_method(sel_getUid("setSendsWholeSearchString:"),function(_34,_35,_36){
with(_34){
_sendsWholeSearchString=_36;
}
}),new objj_method(sel_getUid("sendsSearchStringImmediately"),function(_37,_38){
with(_37){
return _sendsSearchStringImmediately;
}
}),new objj_method(sel_getUid("setSendsSearchStringImmediately:"),function(_39,_3a,_3b){
with(_39){
_sendsSearchStringImmediately=_3b;
}
}),new objj_method(sel_getUid("maximumRecents"),function(_3c,_3d){
with(_3c){
return _maximumRecents;
}
}),new objj_method(sel_getUid("setMaximumRecents:"),function(_3e,_3f,max){
with(_3e){
if(max>254){
max=254;
}else{
if(max<0){
max=10;
}
}
_maximumRecents=max;
}
}),new objj_method(sel_getUid("recentSearches"),function(_40,_41){
with(_40){
return _recentSearches;
}
}),new objj_method(sel_getUid("setRecentSearches:"),function(_42,_43,_44){
with(_42){
var max=MIN(objj_msgSend(_42,"maximumRecents"),objj_msgSend(_44,"count")),_44=objj_msgSend(_44,"subarrayWithRange:",CPMakeRange(0,max));
_recentSearches=_44;
objj_msgSend(_42,"_autosaveRecentSearchList");
}
}),new objj_method(sel_getUid("recentsAutosaveName"),function(_45,_46){
with(_45){
return _recentsAutosaveName;
}
}),new objj_method(sel_getUid("setRecentsAutosaveName:"),function(_47,_48,_49){
with(_47){
if(_recentsAutosaveName!=nil){
objj_msgSend(_47,"_deregisterForAutosaveNotification");
}
_recentsAutosaveName=_49;
if(_recentsAutosaveName!=nil){
objj_msgSend(_47,"_registerForAutosaveNotification");
}
}
}),new objj_method(sel_getUid("contentRectForBounds:"),function(_4a,_4b,_4c){
with(_4a){
var _4d=objj_msgSendSuper({receiver:_4a,super_class:objj_getClass("CPSearchField").super_class},"contentRectForBounds:",_4c);
return objj_msgSend(_4a,"searchTextRectForBounds:",_4d);
}
}),new objj_method(sel_getUid("menu"),function(_4e,_4f){
with(_4e){
return _searchMenu;
}
}),new objj_method(sel_getUid("isOpaque"),function(_50,_51){
with(_50){
return objj_msgSendSuper({receiver:_50,super_class:objj_getClass("CPSearchField").super_class},"isOpaque")&&objj_msgSend(_cancelButton,"isOpaque")&&objj_msgSend(_searchButton,"isOpaque");
}
}),new objj_method(sel_getUid("_updateCancelButtonVisibility"),function(_52,_53){
with(_52){
objj_msgSend(_cancelButton,"setHidden:",(objj_msgSend(objj_msgSend(_52,"stringValue"),"length")===0));
}
}),new objj_method(sel_getUid("controlTextDidChange:"),function(_54,_55,_56){
with(_54){
if(!objj_msgSend(_54,"sendsWholeSearchString")){
if(objj_msgSend(_54,"sendsSearchStringImmediately")){
objj_msgSend(_54,"_sendPartialString");
}else{
objj_msgSend(_partialStringTimer,"invalidate");
var _57=objj_msgSend(CPSearchField,"_keyboardDelayForPartialSearchString:",objj_msgSend(_54,"stringValue"));
_partialStringTimer=objj_msgSend(CPTimer,"scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:",_57,_54,sel_getUid("_sendPartialString"),nil,NO);
}
}
objj_msgSend(_54,"_updateCancelButtonVisibility");
}
}),new objj_method(sel_getUid("_sendAction:"),function(_58,_59,_5a){
with(_58){
objj_msgSend(_58,"sendAction:to:",objj_msgSend(_58,"action"),objj_msgSend(_58,"target"));
}
}),new objj_method(sel_getUid("sendAction:to:"),function(_5b,_5c,_5d,_5e){
with(_5b){
objj_msgSendSuper({receiver:_5b,super_class:objj_getClass("CPSearchField").super_class},"sendAction:to:",_5d,_5e);
objj_msgSend(_partialStringTimer,"invalidate");
objj_msgSend(_5b,"_addStringToRecentSearches:",objj_msgSend(_5b,"stringValue"));
objj_msgSend(_5b,"_updateCancelButtonVisibility");
}
}),new objj_method(sel_getUid("_addStringToRecentSearches:"),function(_5f,_60,_61){
with(_5f){
if(_61===nil||_61===""||objj_msgSend(_recentSearches,"containsObject:",_61)){
return;
}
var _62=objj_msgSend(CPMutableArray,"arrayWithArray:",_recentSearches);
objj_msgSend(_62,"addObject:",_61);
objj_msgSend(_5f,"setRecentSearches:",_62);
objj_msgSend(_5f,"_updateSearchMenu");
}
}),new objj_method(sel_getUid("trackMouse:"),function(_63,_64,_65){
with(_63){
var _66,_67,_68=objj_msgSend(_65,"locationInWindow");
_67=objj_msgSend(_63,"convertPoint:fromView:",_68,nil);
_66=objj_msgSend(_63,"searchButtonRectForBounds:",objj_msgSend(_63,"frame"));
if(CPRectContainsPoint(_66,_67)){
return objj_msgSend(objj_msgSend(_63,"searchButton"),"trackMouse:",_65);
}
_66=objj_msgSend(_63,"cancelButtonRectForBounds:",objj_msgSend(_63,"frame"));
if(CPRectContainsPoint(_66,_67)){
return objj_msgSend(objj_msgSend(_63,"cancelButton"),"trackMouse:",_65);
}
return objj_msgSendSuper({receiver:_63,super_class:objj_getClass("CPSearchField").super_class},"trackMouse:",_65);
}
}),new objj_method(sel_getUid("_defaultSearchMenuTemplate"),function(_69,_6a){
with(_69){
var _6b,_6c;
_6b=objj_msgSend(objj_msgSend(CPMenu,"alloc"),"init");
_6c=objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Recent searches",NULL,"");
objj_msgSend(_6c,"setTag:",CPSearchFieldRecentsTitleMenuItemTag);
objj_msgSend(_6c,"setEnabled:",NO);
objj_msgSend(_6b,"addItem:",_6c);
_6c=objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Recent search item",sel_getUid("_searchFieldSearch:"),"");
objj_msgSend(_6c,"setTag:",CPSearchFieldRecentsMenuItemTag);
objj_msgSend(_6c,"setTarget:",_69);
objj_msgSend(_6b,"addItem:",_6c);
_6c=objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","Clear recent searches",sel_getUid("_searchFieldClearRecents:"),"");
objj_msgSend(_6c,"setTag:",CPSearchFieldClearRecentsMenuItemTag);
objj_msgSend(_6c,"setTarget:",_69);
objj_msgSend(_6b,"addItem:",_6c);
_6c=objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:","No recent searches",NULL,"");
objj_msgSend(_6c,"setTag:",CPSearchFieldNoRecentsMenuItemTag);
objj_msgSend(_6c,"setEnabled:",NO);
objj_msgSend(_6b,"addItem:",_6c);
return _6b;
}
}),new objj_method(sel_getUid("_updateSearchMenu"),function(_6d,_6e){
with(_6d){
if(_searchMenuTemplate===nil){
return;
}
var i,_6f=objj_msgSend(objj_msgSend(CPMenu,"alloc"),"init"),_70=objj_msgSend(_recentSearches,"count"),_71=objj_msgSend(_searchMenuTemplate,"numberOfItems");
for(i=0;i<_71;i++){
var _72=objj_msgSend(_searchMenuTemplate,"itemAtIndex:",i),tag=objj_msgSend(_72,"tag");
if(!(tag===CPSearchFieldRecentsTitleMenuItemTag&&_70===0)&&!(tag===CPSearchFieldClearRecentsMenuItemTag&&_70===0)&&!(tag===CPSearchFieldNoRecentsMenuItemTag&&_70!=0)&&!(tag===CPSearchFieldRecentsMenuItemTag)){
var _73,_74;
switch(tag){
case CPSearchFieldRecentsTitleMenuItemTag:
_73=NULL;
_74=NULL;
break;
case CPSearchFieldClearRecentsMenuItemTag:
_73=sel_getUid("_searchFieldClearRecents:");
_74=_6d;
break;
case CPSearchFieldNoRecentsMenuItemTag:
_73=NULL;
_74=NULL;
break;
default:
_73=objj_msgSend(_72,"action");
_74=objj_msgSend(_72,"target");
break;
}
if(tag===CPSearchFieldClearRecentsMenuItemTag||tag===CPSearchFieldRecentsTitleMenuItemTag){
var _75=objj_msgSend(CPMenuItem,"separatorItem");
objj_msgSend(_75,"setEnabled:",NO);
objj_msgSend(_6f,"addItem:",_75);
}
var _76=objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:",objj_msgSend(_72,"title"),_73,objj_msgSend(_72,"keyEquivalent"));
objj_msgSend(_76,"setTarget:",_74);
objj_msgSend(_76,"setEnabled:",(objj_msgSend(_72,"isEnabled")&&_73!=NULL));
objj_msgSend(_76,"setTag:",tag);
objj_msgSend(_6f,"addItem:",_76);
}else{
if(tag===CPSearchFieldRecentsMenuItemTag){
var j;
for(j=0;j<_70;j++){
var _77=objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:",objj_msgSend(_recentSearches,"objectAtIndex:",j),sel_getUid("_searchFieldSearch:"),objj_msgSend(_72,"keyEquivalent"));
objj_msgSend(_77,"setTarget:",_6d);
objj_msgSend(_6f,"addItem:",_77);
}
}
}
}
_searchMenu=_6f;
}
}),new objj_method(sel_getUid("_showMenu:"),function(_78,_79,_7a){
with(_78){
if(_searchMenu===nil||objj_msgSend(_searchMenu,"numberOfItems")===0||!objj_msgSend(_78,"isEnabled")){
return;
}
var _7b=objj_msgSend(objj_msgSend(_78,"superview"),"convertRect:toView:",objj_msgSend(_78,"frame"),nil),_7c=CPMakePoint(_7b.origin.x+10,_7b.origin.y+_7b.size.height-4);
var _7d=objj_msgSend(CPEvent,"mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:",CPRightMouseDown,_7c,0,objj_msgSend(objj_msgSend(CPApp,"currentEvent"),"timestamp"),objj_msgSend(objj_msgSend(_78,"window"),"windowNumber"),nil,1,1,0);
objj_msgSend(CPMenu,"popUpContextMenu:withEvent:forView:",_searchMenu,_7d,_7a);
}
}),new objj_method(sel_getUid("_sendPartialString"),function(_7e,_7f){
with(_7e){
objj_msgSend(objj_msgSend(_7e,"target"),"performSelector:withObject:",objj_msgSend(_7e,"action"),_7e);
}
}),new objj_method(sel_getUid("_searchFieldCancel:"),function(_80,_81,_82){
with(_80){
objj_msgSend(_80,"setObjectValue:","");
objj_msgSend(_80,"_sendPartialString");
objj_msgSend(_80,"_updateCancelButtonVisibility");
}
}),new objj_method(sel_getUid("_searchFieldSearch:"),function(_83,_84,_85){
with(_83){
var _86=objj_msgSend(_85,"title");
if(objj_msgSend(_85,"tag")!=CPSearchFieldRecentsMenuItemTag){
objj_msgSend(_83,"_addStringToRecentSearches:",_86);
}
objj_msgSend(_83,"setObjectValue:",_86);
objj_msgSend(_83,"_sendPartialString");
objj_msgSend(_83,"_updateCancelButtonVisibility");
}
}),new objj_method(sel_getUid("_searchFieldClearRecents:"),function(_87,_88,_89){
with(_87){
objj_msgSend(_87,"setRecentSearches:",objj_msgSend(CPArray,"array"));
objj_msgSend(_87,"_updateSearchMenu");
}
}),new objj_method(sel_getUid("_registerForAutosaveNotification"),function(_8a,_8b){
with(_8a){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"addObserver:selector:name:object:",_8a,sel_getUid("_updateAutosavedRecents:"),"CPAutosavedRecentsChangedNotification",nil);
}
}),new objj_method(sel_getUid("_deregisterForAutosaveNotification"),function(_8c,_8d){
with(_8c){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"removeObserver:name:object:",_8c,"CPAutosavedRecentsChangedNotification",nil);
}
}),new objj_method(sel_getUid("_autosaveRecentSearchList"),function(_8e,_8f){
with(_8e){
if(_recentsAutosaveName!=nil){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:","CPAutosavedRecentsChangedNotification",_recentsAutosaveName);
}
}
}),new objj_method(sel_getUid("_updateAutosavedRecents:"),function(_90,_91,_92){
with(_90){
var _93=objj_msgSend(_90,"recentSearches"),_94=objj_msgSend(_92,"object"),_95=objj_msgSend(objj_msgSend(objj_msgSend(CPBundle,"mainBundle"),"infoDictionary"),"objectForKey:","CPBundleName"),_96=objj_msgSend(_95,"lowercaseString")+"."+objj_msgSend(_92,"object"),_97=objj_msgSend(objj_msgSend(CPCookie,"alloc"),"initWithName:",_96),_98=objj_msgSend(_93,"componentsJoinedByString:",",");
objj_msgSend(_97,"setValue:expires:domain:",_98,objj_msgSend(objj_msgSend(CPDate,"alloc"),"initWithTimeIntervalSinceNow:",3600*24*365),(window.location.href.hostname));
}
}),new objj_method(sel_getUid("_loadRecentSearchList"),function(_99,_9a){
with(_99){
var _9b,_9c=objj_msgSend(_99,"recentsAutosaveName");
if(_9c===nil){
return;
}
var _9d=objj_msgSend(objj_msgSend(objj_msgSend(CPBundle,"mainBundle"),"infoDictionary"),"objectForKey:","CPBundleName"),_9e=objj_msgSend(_9d,"lowercaseString")+"."+_9c,_9f=objj_msgSend(objj_msgSend(CPCookie,"alloc"),"initWithName:",_9e);
if(_9f!=nil){
var _a0=objj_msgSend(_9f,"value");
_9b=(_a0!="")?objj_msgSend(_a0,"componentsSeparatedByString:",","):objj_msgSend(CPArray,"array");
_recentSearches=_9b;
}
}
})]);
class_addMethods(_6,[new objj_method(sel_getUid("initialize"),function(_a1,_a2){
with(_a1){
if(_a1!=objj_msgSend(CPSearchField,"class")){
return;
}
var _a3=objj_msgSend(CPBundle,"bundleForClass:",_a1);
_1=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:",objj_msgSend(_a3,"pathForResource:","CPSearchField/CPSearchFieldSearch.png"));
_2=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:",objj_msgSend(_a3,"pathForResource:","CPSearchField/CPSearchFieldFind.png"));
_3=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:",objj_msgSend(_a3,"pathForResource:","CPSearchField/CPSearchFieldCancel.png"));
_4=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:",objj_msgSend(_a3,"pathForResource:","CPSearchField/CPSearchFieldCancelPressed.png"));
}
}),new objj_method(sel_getUid("_keyboardDelayForPartialSearchString:"),function(_a4,_a5,_a6){
with(_a4){
return (6-MIN(objj_msgSend(_a6,"length"),4))/10;
}
})]);
var _a7="CPSearchButtonKey",_a8="CPCancelButtonKey",_a9="CPRecentsAutosaveNameKey",_aa="CPSendsWholeSearchStringKey",_ab="CPSendsSearchStringImmediatelyKey",_ac="CPMaximumRecentsKey",_ad="CPSearchMenuTemplateKey";
var _5=objj_getClass("CPSearchField");
if(!_5){
throw new SyntaxError("*** Could not find definition for class \"CPSearchField\"");
}
var _6=_5.isa;
class_addMethods(_5,[new objj_method(sel_getUid("encodeWithCoder:"),function(_ae,_af,_b0){
with(_ae){
objj_msgSendSuper({receiver:_ae,super_class:objj_getClass("CPSearchField").super_class},"encodeWithCoder:",_b0);
objj_msgSend(_b0,"encodeObject:forKey:",_searchButton,_a7);
objj_msgSend(_b0,"encodeObject:forKey:",_cancelButton,_a8);
objj_msgSend(_b0,"encodeBool:forKey:",_sendsWholeSearchString,_aa);
objj_msgSend(_b0,"encodeBool:forKey:",_sendsSearchStringImmediately,_ab);
objj_msgSend(_b0,"encodeInt:forKey:",_maximumRecents,_ac);
if(_recentsAutosaveName){
objj_msgSend(_b0,"encodeObject:forKey:",_recentsAutosaveName,_a9);
}
if(_searchMenuTemplate){
objj_msgSend(_b0,"encodeObject:forKey:",_searchMenuTemplate,_ad);
}
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_b1,_b2,_b3){
with(_b1){
if(_b1=objj_msgSendSuper({receiver:_b1,super_class:objj_getClass("CPSearchField").super_class},"initWithCoder:",_b3)){
_searchButton=objj_msgSend(_b3,"decodeObjectForKey:",_a7);
_cancelButton=objj_msgSend(_b3,"decodeObjectForKey:",_a8);
_recentsAutosaveName=objj_msgSend(_b3,"decodeObjectForKey:",_a9);
_sendsWholeSearchString=objj_msgSend(_b3,"decodeBoolForKey:",_aa);
_sendsSearchStringImmediately=objj_msgSend(_b3,"decodeBoolForKey:",_ab);
_maximumRecents=objj_msgSend(_b3,"decodeIntForKey:",_ac);
var _b4=objj_msgSend(_b3,"decodeObjectForKey:",_ad);
if(_b4){
objj_msgSend(_b1,"setSearchMenuTemplate:",_b4);
}
objj_msgSend(_b1,"setDelegate:",_b1);
}
return _b1;
}
})]);
p;19;CPSecureTextField.jt;285;@STATIC;1.0;i;13;CPTextField.jt;249;
objj_executeFile("CPTextField.j",YES);
var _1=objj_allocateClassPair(CPTextField,"CPSecureTextField"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("isSecure"),function(_3,_4){
with(_3){
return YES;
}
})]);
p;20;CPSegmentedControl.jt;21022;@STATIC;1.0;I;20;Foundation/CPArray.ji;11;CPControl.jt;20961;
objj_executeFile("Foundation/CPArray.j",NO);
objj_executeFile("CPControl.j",YES);
CPSegmentSwitchTrackingSelectOne=0;
CPSegmentSwitchTrackingSelectAny=1;
CPSegmentSwitchTrackingMomentary=2;
var _1=objj_allocateClassPair(CPControl,"CPSegmentedControl"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_segments"),new objj_ivar("_themeStates"),new objj_ivar("_selectedSegment"),new objj_ivar("_segmentStyle"),new objj_ivar("_trackingMode"),new objj_ivar("_trackingSegment"),new objj_ivar("_trackingHighlighted")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithFrame:"),function(_3,_4,_5){
with(_3){
_segments=[];
_themeStates=[];
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPSegmentedControl").super_class},"initWithFrame:",_5);
if(_3){
_selectedSegment=-1;
_trackingMode=CPSegmentSwitchTrackingSelectOne;
}
return _3;
}
}),new objj_method(sel_getUid("selectedTag"),function(_6,_7){
with(_6){
return _segments[_selectedSegment].tag;
}
}),new objj_method(sel_getUid("setSegmentCount:"),function(_8,_9,_a){
with(_8){
if(_segments.length==_a){
return;
}
var _b=CGRectGetHeight(objj_msgSend(_8,"bounds"));
if(_segments.length<_a){
for(var _c=_segments.length;_c<_a;++_c){
_segments[_c]=objj_msgSend(objj_msgSend(_CPSegmentItem,"alloc"),"init");
_themeStates[_c]=CPThemeStateNormal;
}
}else{
if(_a<_segments.length){
_segments.length=_a;
_themeStates.length=_a;
}
}
if(_selectedSegment>=_segments.length){
_selectedSegment=-1;
}
objj_msgSend(_8,"tileWithChangedSegment:",0);
}
}),new objj_method(sel_getUid("segmentCount"),function(_d,_e){
with(_d){
return _segments.length;
}
}),new objj_method(sel_getUid("setSelectedSegment:"),function(_f,_10,_11){
with(_f){
objj_msgSend(_f,"setSelected:forSegment:",YES,_11);
}
}),new objj_method(sel_getUid("selectedSegment"),function(_12,_13){
with(_12){
return _selectedSegment;
}
}),new objj_method(sel_getUid("selectSegmentWithTag:"),function(_14,_15,_16){
with(_14){
var _17=0;
for(;_17<_segments.length;++_17){
if(_segments[_17].tag==_16){
objj_msgSend(_14,"setSelectedSegment:",_17);
return YES;
}
}
return NO;
}
}),new objj_method(sel_getUid("isTracking"),function(_18,_19){
with(_18){
}
}),new objj_method(sel_getUid("setTrackingMode:"),function(_1a,_1b,_1c){
with(_1a){
if(_trackingMode==_1c){
return;
}
_trackingMode=_1c;
if(_trackingMode==CPSegmentSwitchTrackingSelectOne){
var _1d=0,_1e=NO;
for(;_1d<_segments.length;++_1d){
if(_segments[_1d].selected){
if(_1e){
objj_msgSend(_1a,"setSelected:forSegment:",NO,_1d);
}else{
_1e=YES;
}
}
}
}else{
if(_trackingMode==CPSegmentSwitchTrackingMomentary){
var _1d=0;
for(;_1d<_segments.length;++_1d){
if(_segments[_1d].selected){
objj_msgSend(_1a,"setSelected:forSegment:",NO,_1d);
}
}
}
}
}
}),new objj_method(sel_getUid("trackingMode"),function(_1f,_20){
with(_1f){
return _trackingMode;
}
}),new objj_method(sel_getUid("setWidth:forSegment:"),function(_21,_22,_23,_24){
with(_21){
_segments[_24].width=_23;
objj_msgSend(_21,"tileWithChangedSegment:",_24);
}
}),new objj_method(sel_getUid("widthForSegment:"),function(_25,_26,_27){
with(_25){
return _segments[_27].width;
}
}),new objj_method(sel_getUid("setImage:forSegment:"),function(_28,_29,_2a,_2b){
with(_28){
var _2c=_segments[_2b];
_2c.image=_2a;
objj_msgSend(_28,"tileWithChangedSegment:",_2b);
}
}),new objj_method(sel_getUid("imageForSegment:"),function(_2d,_2e,_2f){
with(_2d){
return _segments[_2f].image;
}
}),new objj_method(sel_getUid("setLabel:forSegment:"),function(_30,_31,_32,_33){
with(_30){
var _34=_segments[_33];
_segments[_33].label=_32;
objj_msgSend(_30,"tileWithChangedSegment:",_33);
}
}),new objj_method(sel_getUid("labelForSegment:"),function(_35,_36,_37){
with(_35){
return _segments[_37].label;
}
}),new objj_method(sel_getUid("setMenu:forSegment:"),function(_38,_39,_3a,_3b){
with(_38){
_segments[_3b].menu=_3a;
}
}),new objj_method(sel_getUid("menuForSegment:"),function(_3c,_3d,_3e){
with(_3c){
return _segments[_3e].menu;
}
}),new objj_method(sel_getUid("setSelected:forSegment:"),function(_3f,_40,_41,_42){
with(_3f){
var _43=_segments[_42];
if(_43.selected==_41){
return;
}
_43.selected=_41;
_themeStates[_42]=_41?CPThemeStateSelected:CPThemeStateNormal;
if(_41){
var _44=_selectedSegment;
_selectedSegment=_42;
if(_trackingMode==CPSegmentSwitchTrackingSelectOne&&_44!=_42&&_44!=-1){
_segments[_44].selected=NO;
_themeStates[_44]=CPThemeStateNormal;
objj_msgSend(_3f,"drawSegmentBezel:highlight:",_44,NO);
}
}
if(_trackingMode!=CPSegmentSwitchTrackingMomentary){
objj_msgSend(_3f,"drawSegmentBezel:highlight:",_42,NO);
}
objj_msgSend(_3f,"setNeedsLayout");
objj_msgSend(_3f,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("isSelectedForSegment:"),function(_45,_46,_47){
with(_45){
return _segments[_47].selected;
}
}),new objj_method(sel_getUid("setEnabled:forSegment:"),function(_48,_49,_4a,_4b){
with(_48){
if(_4a){
_themeStates[_4b]&=~CPThemeStateDisabled;
}else{
_themeStates[_4b]|=CPThemeStateDisabled;
}
objj_msgSend(_48,"setNeedsLayout");
objj_msgSend(_48,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("isEnabledForSegment:"),function(_4c,_4d,_4e){
with(_4c){
return !(_themeStates[_4e]&CPThemeStateDisabled);
}
}),new objj_method(sel_getUid("setTag:forSegment:"),function(_4f,_50,_51,_52){
with(_4f){
_segments[_52].tag=_51;
}
}),new objj_method(sel_getUid("tagForSegment:"),function(_53,_54,_55){
with(_53){
return _segments[_55].tag;
}
}),new objj_method(sel_getUid("drawSegmentBezel:highlight:"),function(_56,_57,_58,_59){
with(_56){
if(_59){
_themeStates[_58]|=CPThemeStateHighlighted;
}else{
_themeStates[_58]&=~CPThemeStateHighlighted;
}
objj_msgSend(_56,"setNeedsLayout");
objj_msgSend(_56,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("_leftOffsetForSegment:"),function(_5a,_5b,_5c){
with(_5a){
var _5d=objj_msgSend(_5a,"currentValueForThemeAttribute:","bezel-inset");
if(_5c==0){
return _5d.left;
}
var _5e=objj_msgSend(_5a,"currentValueForThemeAttribute:","divider-thickness");
return objj_msgSend(_5a,"_leftOffsetForSegment:",_5c-1)+objj_msgSend(_5a,"widthForSegment:",_5c-1)+_5e;
}
}),new objj_method(sel_getUid("_indexOfLastSegment"),function(_5f,_60){
with(_5f){
var _61=objj_msgSend(_segments,"count")-1;
if(_61<0){
_61=0;
}
return _61;
}
}),new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"),function(_62,_63,_64){
with(_62){
var _65=objj_msgSend(_62,"currentValueForThemeAttribute:","default-height"),_66=objj_msgSend(_62,"currentValueForThemeAttribute:","content-inset"),_67=objj_msgSend(_62,"currentValueForThemeAttribute:","bezel-inset"),_68=objj_msgSend(_62,"bounds");
if(_64==="left-segment-bezel"){
return CGRectMake(_67.left,_67.top,_66.left,_65);
}else{
if(_64==="right-segment-bezel"){
return CPRectMake(CGRectGetWidth(objj_msgSend(_62,"bounds"))-_66.right,_67.top,_66.right,_65);
}else{
if(_64.indexOf("segment-bezel")===0){
var _69=parseInt(_64.substring("segment-bezel-".length),10),_6a=CGRectCreateCopy(_segments[_69].frame);
if(_69===0){
_6a.origin.x+=_66.left;
_6a.size.width-=_66.left;
}
if(_69===_segments.length-1){
_6a.size.width=CGRectGetWidth(objj_msgSend(_62,"bounds"))-_66.right-_6a.origin.x;
}
return _6a;
}else{
if(_64.indexOf("divider-bezel")===0){
var _69=parseInt(_64.substring("divider-bezel-".length),10),_6b=objj_msgSend(_62,"widthForSegment:",_69),_6c=objj_msgSend(_62,"_leftOffsetForSegment:",_69),_6d=objj_msgSend(_62,"currentValueForThemeAttribute:","divider-thickness");
return CGRectMake(_6c+_6b,_67.top,_6d,_65);
}else{
if(_64.indexOf("segment-content")===0){
var _69=parseInt(_64.substring("segment-content-".length),10);
return objj_msgSend(_62,"contentFrameForSegment:",_69);
}
}
}
}
}
return objj_msgSendSuper({receiver:_62,super_class:objj_getClass("CPSegmentedControl").super_class},"rectForEphemeralSubviewNamed:",_64);
}
}),new objj_method(sel_getUid("createEphemeralSubviewNamed:"),function(_6e,_6f,_70){
with(_6e){
if(_70.substring(0,"segment-content".length)=="segment-content"){
return objj_msgSend(objj_msgSend(_CPImageAndTextView,"alloc"),"initWithFrame:",{origin:{x:0,y:0},size:{width:0,height:0}});
}
return objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",{origin:{x:0,y:0},size:{width:0,height:0}});
}
}),new objj_method(sel_getUid("layoutSubviews"),function(_71,_72){
with(_71){
if(_segments.length<=0){
return;
}
var _73=_themeStates[0];
_73|=_themeState&CPThemeStateDisabled;
var _74=objj_msgSend(_71,"valueForThemeAttribute:inState:","left-segment-bezel-color",_73);
var _75=objj_msgSend(_71,"layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:","left-segment-bezel",CPWindowBelow,nil);
objj_msgSend(_75,"setBackgroundColor:",_74);
var _73=_themeStates[_themeStates.length-1];
_73|=_themeState&CPThemeStateDisabled;
var _76=objj_msgSend(_71,"valueForThemeAttribute:inState:","right-segment-bezel-color",_73);
var _77=objj_msgSend(_71,"layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:","right-segment-bezel",CPWindowBelow,nil);
objj_msgSend(_77,"setBackgroundColor:",_76);
for(var i=0,_78=_themeStates.length;i<_78;i++){
var _73=_themeStates[i];
_73|=_themeState&CPThemeStateDisabled;
var _79=objj_msgSend(_71,"valueForThemeAttribute:inState:","center-segment-bezel-color",_73);
var _7a=objj_msgSend(_71,"layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:","segment-bezel-"+i,CPWindowBelow,nil);
objj_msgSend(_7a,"setBackgroundColor:",_79);
var _7b=_segments[i];
var _7c=objj_msgSend(_71,"layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:","segment-content-"+i,CPWindowAbove,"segment-bezel-"+i);
objj_msgSend(_7c,"setText:",_7b.label);
objj_msgSend(_7c,"setImage:",_7b.image);
objj_msgSend(_7c,"setFont:",objj_msgSend(_71,"valueForThemeAttribute:inState:","font",_73));
objj_msgSend(_7c,"setTextColor:",objj_msgSend(_71,"valueForThemeAttribute:inState:","text-color",_73));
objj_msgSend(_7c,"setAlignment:",objj_msgSend(_71,"valueForThemeAttribute:inState:","alignment",_73));
objj_msgSend(_7c,"setVerticalAlignment:",objj_msgSend(_71,"valueForThemeAttribute:inState:","vertical-alignment",_73));
objj_msgSend(_7c,"setLineBreakMode:",objj_msgSend(_71,"valueForThemeAttribute:inState:","line-break-mode",_73));
objj_msgSend(_7c,"setTextShadowColor:",objj_msgSend(_71,"valueForThemeAttribute:inState:","text-shadow-color",_73));
objj_msgSend(_7c,"setTextShadowOffset:",objj_msgSend(_71,"valueForThemeAttribute:inState:","text-shadow-offset",_73));
objj_msgSend(_7c,"setImageScaling:",objj_msgSend(_71,"valueForThemeAttribute:inState:","image-scaling",_73));
if(_7b.image&&_7b.label){
objj_msgSend(_7c,"setImagePosition:",objj_msgSend(_71,"valueForThemeAttribute:inState:","image-position",_73));
}else{
if(_7b.image){
objj_msgSend(_7c,"setImagePosition:",CPImageOnly);
}
}
if(i==_78-1){
continue;
}
var _7d=_themeStates[i]|_themeStates[i+1];
_7d=(_7d&CPThemeStateSelected&~CPThemeStateHighlighted)?CPThemeStateSelected:CPThemeStateNormal;
_7d|=_themeState&CPThemeStateDisabled;
var _7e=objj_msgSend(_71,"valueForThemeAttribute:inState:","divider-bezel-color",_7d);
var _7f=objj_msgSend(_71,"layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:","divider-bezel-"+i,CPWindowBelow,nil);
objj_msgSend(_7f,"setBackgroundColor:",_7e);
}
}
}),new objj_method(sel_getUid("drawSegment:highlight:"),function(_80,_81,_82,_83){
with(_80){
}
}),new objj_method(sel_getUid("tileWithChangedSegment:"),function(_84,_85,_86){
with(_84){
if(_86>=_segments.length){
return;
}
var _87=_segments[_86],_88=_87.width,_89=_themeStates[_86]|(_themeState&CPThemeStateDisabled),_8a=objj_msgSend(_84,"valueForThemeAttribute:inState:","content-inset",_89),_8b=objj_msgSend(_84,"valueForThemeAttribute:inState:","font",_89);
if(!_88){
if(_87.image&&_87.label){
_88=objj_msgSend(_87.label,"sizeWithFont:",_8b).width+objj_msgSend(_87.image,"size").width+_8a.left+_8a.right;
}else{
if(_87.image){
_88=objj_msgSend(_87.image,"size").width+_8a.left+_8a.right;
}else{
if(_87.label){
_88=objj_msgSend(_87.label,"sizeWithFont:",_8b).width+_8a.left+_8a.right;
}else{
_88=0;
}
}
}
}
var _8c=_88-CGRectGetWidth(_87.frame);
if(!_8c){
return;
}
var _8d=objj_msgSend(_84,"frame");
objj_msgSend(_84,"setFrameSize:",CGSizeMake(CGRectGetWidth(_8d)+_8c,CGRectGetHeight(_8d)));
_87.width=_88;
_87.frame=objj_msgSend(_84,"frameForSegment:",_86);
var _8e=_86+1;
for(;_8e<_segments.length;++_8e){
_segments[_8e].frame.origin.x+=_8c;
objj_msgSend(_84,"drawSegmentBezel:highlight:",_8e,NO);
objj_msgSend(_84,"drawSegment:highlight:",_8e,NO);
}
objj_msgSend(_84,"drawSegmentBezel:highlight:",_86,NO);
objj_msgSend(_84,"drawSegment:highlight:",_86,NO);
objj_msgSend(_84,"setNeedsLayout");
objj_msgSend(_84,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("frameForSegment:"),function(_8f,_90,_91){
with(_8f){
return objj_msgSend(_8f,"bezelFrameForSegment:",_91);
}
}),new objj_method(sel_getUid("bezelFrameForSegment:"),function(_92,_93,_94){
with(_92){
var _95=objj_msgSend(_92,"currentValueForThemeAttribute:","default-height"),_96=objj_msgSend(_92,"currentValueForThemeAttribute:","bezel-inset"),_97=objj_msgSend(_92,"widthForSegment:",_94),_98=objj_msgSend(_92,"_leftOffsetForSegment:",_94);
return CGRectMake(_98,_96.top,_97,_95);
}
}),new objj_method(sel_getUid("contentFrameForSegment:"),function(_99,_9a,_9b){
with(_99){
var _9c=objj_msgSend(_99,"currentValueForThemeAttribute:","default-height"),_9d=objj_msgSend(_99,"currentValueForThemeAttribute:","content-inset"),_9e=objj_msgSend(_99,"widthForSegment:",_9b),_9f=objj_msgSend(_99,"_leftOffsetForSegment:",_9b);
return CGRectMake(_9f+_9d.left,_9d.top,_9e-_9d.left-_9d.right,_9c-_9d.top-_9d.bottom);
}
}),new objj_method(sel_getUid("testSegment:"),function(_a0,_a1,_a2){
with(_a0){
var _a3=objj_msgSend(_a0,"convertPoint:fromView:",_a2,nil),_a4=_segments.length;
while(_a4--){
if(CGRectContainsPoint(_segments[_a4].frame,_a2)){
return _a4;
}
}
if(_segments.length){
var _a5=CGRectCreateCopy(_segments[_segments.length-1].frame);
_a5.size.width=CGRectGetWidth(objj_msgSend(_a0,"bounds"))-_a5.origin.x;
if(CGRectContainsPoint(_a5,_a2)){
return _segments.length-1;
}
}
return -1;
}
}),new objj_method(sel_getUid("mouseDown:"),function(_a6,_a7,_a8){
with(_a6){
if(!objj_msgSend(_a6,"isEnabled")){
return;
}
objj_msgSend(_a6,"trackSegment:",_a8);
}
}),new objj_method(sel_getUid("mouseUp:"),function(_a9,_aa,_ab){
with(_a9){
}
}),new objj_method(sel_getUid("trackSegment:"),function(_ac,_ad,_ae){
with(_ac){
var _af=objj_msgSend(_ae,"type"),_b0=objj_msgSend(_ac,"convertPoint:fromView:",objj_msgSend(_ae,"locationInWindow"),nil);
if(_af==CPLeftMouseUp){
if(_trackingSegment==-1){
return;
}
if(_trackingSegment===objj_msgSend(_ac,"testSegment:",_b0)){
if(_trackingMode==CPSegmentSwitchTrackingSelectAny){
objj_msgSend(_ac,"setSelected:forSegment:",!objj_msgSend(_ac,"isSelectedForSegment:",_trackingSegment),_trackingSegment);
_selectedSegment=_trackingSegment;
}else{
objj_msgSend(_ac,"setSelected:forSegment:",YES,_trackingSegment);
}
objj_msgSend(_ac,"sendAction:to:",objj_msgSend(_ac,"action"),objj_msgSend(_ac,"target"));
if(_trackingMode==CPSegmentSwitchTrackingMomentary){
objj_msgSend(_ac,"setSelected:forSegment:",NO,_trackingSegment);
_selectedSegment=-1;
}
}
objj_msgSend(_ac,"drawSegmentBezel:highlight:",_trackingSegment,NO);
_trackingSegment=-1;
return;
}
if(_af==CPLeftMouseDown){
var _b1=objj_msgSend(_ac,"testSegment:",_b0);
if(_b1>-1&&objj_msgSend(_ac,"isEnabledForSegment:",_b1)){
_trackingHighlighted=YES;
_trackingSegment=_b1;
objj_msgSend(_ac,"drawSegmentBezel:highlight:",_trackingSegment,YES);
}
}else{
if(_af==CPLeftMouseDragged){
if(_trackingSegment==-1){
return;
}
var _b2=objj_msgSend(_ac,"testSegment:",_b0)===_trackingSegment;
if(_b2!=_trackingHighlighted){
_trackingHighlighted=_b2;
objj_msgSend(_ac,"drawSegmentBezel:highlight:",_trackingSegment,_trackingHighlighted);
}
}
}
objj_msgSend(CPApp,"setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:",_ac,sel_getUid("trackSegment:"),CPLeftMouseDraggedMask|CPLeftMouseUpMask,nil,nil,YES);
}
}),new objj_method(sel_getUid("setFont:"),function(_b3,_b4,_b5){
with(_b3){
objj_msgSendSuper({receiver:_b3,super_class:objj_getClass("CPSegmentedControl").super_class},"setFont:",_b5);
objj_msgSend(_b3,"tileWithChangedSegment:",0);
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("themeClass"),function(_b6,_b7){
with(_b6){
return "segmented-control";
}
}),new objj_method(sel_getUid("themeAttributes"),function(_b8,_b9){
with(_b8){
return objj_msgSend(CPDictionary,"dictionaryWithObjects:forKeys:",[CPCenterTextAlignment,CPCenterVerticalTextAlignment,CPImageLeft,CPScaleNone,{top:(0),right:(0),bottom:(0),left:(0)},{top:(0),right:(0),bottom:(0),left:(0)},objj_msgSend(CPNull,"null"),objj_msgSend(CPNull,"null"),objj_msgSend(CPNull,"null"),objj_msgSend(CPNull,"null"),1,24],["alignment","vertical-alignment","image-position","image-scaling","bezel-inset","content-inset","left-segment-bezel-color","right-segment-bezel-color","center-segment-bezel-color","divider-bezel-color","divider-thickness","default-height"]);
}
})]);
var _ba="CPSegmentedControlSegmentsKey",_bb="CPSegmentedControlSelectedKey",_bc="CPSegmentedControlSegmentStyleKey",_bd="CPSegmentedControlTrackingModeKey";
var _1=objj_getClass("CPSegmentedControl");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPSegmentedControl\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_be,_bf,_c0){
with(_be){
_be=objj_msgSendSuper({receiver:_be,super_class:objj_getClass("CPSegmentedControl").super_class},"initWithCoder:",_c0);
if(_be){
var _c1=objj_msgSend(_be,"frame"),_c2=_c1.size.width;
_c1.size.width=0;
objj_msgSend(_be,"setFrame:",_c1);
_segments=objj_msgSend(_c0,"decodeObjectForKey:",_ba);
_segmentStyle=objj_msgSend(_c0,"decodeIntForKey:",_bc);
_themeStates=[];
if(objj_msgSend(_c0,"containsValueForKey:",_bb)){
_selectedSegment=objj_msgSend(_c0,"decodeIntForKey:",_bb);
}else{
_selectedSegment=-1;
}
if(objj_msgSend(_c0,"containsValueForKey:",_bd)){
_trackingMode=objj_msgSend(_c0,"decodeIntForKey:",_bd);
}else{
_trackingMode=CPSegmentSwitchTrackingSelectOne;
}
for(var i=0;i<_segments.length;i++){
_themeStates[i]=_segments[i].selected?CPThemeStateSelected:CPThemeStateNormal;
objj_msgSend(_be,"tileWithChangedSegment:",i);
}
var _c3=MAX(_c2-objj_msgSend(_be,"frame").size.width,0),_c4=FLOOR(_c3/_segments.length);
for(var i=0;i<_segments.length;i++){
objj_msgSend(_be,"setWidth:forSegment:",_segments[i].width+_c4,i);
}
objj_msgSend(_be,"tileWithChangedSegment:",0);
}
return _be;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_c5,_c6,_c7){
with(_c5){
objj_msgSendSuper({receiver:_c5,super_class:objj_getClass("CPSegmentedControl").super_class},"encodeWithCoder:",_c7);
objj_msgSend(_c7,"encodeObject:forKey:",_segments,_ba);
objj_msgSend(_c7,"encodeInt:forKey:",_selectedSegment,_bb);
objj_msgSend(_c7,"encodeInt:forKey:",_segmentStyle,_bc);
objj_msgSend(_c7,"encodeInt:forKey:",_trackingMode,_bd);
}
})]);
var _1=objj_allocateClassPair(CPObject,"_CPSegmentItem"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("image"),new objj_ivar("label"),new objj_ivar("menu"),new objj_ivar("selected"),new objj_ivar("enabled"),new objj_ivar("tag"),new objj_ivar("width"),new objj_ivar("frame")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("init"),function(_c8,_c9){
with(_c8){
if(_c8=objj_msgSendSuper({receiver:_c8,super_class:objj_getClass("_CPSegmentItem").super_class},"init")){
image=nil;
label="";
menu=nil;
selected=NO;
enabled=NO;
tag=0;
width=0;
frame=CGRectMakeZero();
}
return _c8;
}
})]);
var _ca="CPSegmentItemImageKey",_cb="CPSegmentItemLabelKey",_cc="CPSegmentItemMenuKey",_cd="CPSegmentItemSelectedKey",_ce="CPSegmentItemEnabledKey",_cf="CPSegmentItemTagKey",_d0="CPSegmentItemWidthKey";
var _1=objj_getClass("_CPSegmentItem");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"_CPSegmentItem\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_d1,_d2,_d3){
with(_d1){
_d1=objj_msgSendSuper({receiver:_d1,super_class:objj_getClass("_CPSegmentItem").super_class},"init");
if(_d1){
image=objj_msgSend(_d3,"decodeObjectForKey:",_ca);
label=objj_msgSend(_d3,"decodeObjectForKey:",_cb);
menu=objj_msgSend(_d3,"decodeObjectForKey:",_cc);
selected=objj_msgSend(_d3,"decodeBoolForKey:",_cd);
enabled=objj_msgSend(_d3,"decodeBoolForKey:",_ce);
tag=objj_msgSend(_d3,"decodeIntForKey:",_cf);
width=objj_msgSend(_d3,"decodeFloatForKey:",_d0);
frame=CGRectMakeZero();
}
return _d1;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_d4,_d5,_d6){
with(_d4){
objj_msgSend(_d6,"encodeObject:forKey:",image,_ca);
objj_msgSend(_d6,"encodeObject:forKey:",label,_cb);
objj_msgSend(_d6,"encodeObject:forKey:",menu,_cc);
objj_msgSend(_d6,"encodeBool:forKey:",selected,_cd);
objj_msgSend(_d6,"encodeBool:forKey:",enabled,_ce);
objj_msgSend(_d6,"encodeInt:forKey:",tag,_cf);
objj_msgSend(_d6,"encodeFloat:forKey:",width,_d0);
}
})]);
p;10;CPShadow.jt;1333;@STATIC;1.0;I;21;Foundation/CPObject.jt;1288;
objj_executeFile("Foundation/CPObject.j",NO);
var _1=objj_allocateClassPair(CPObject,"CPShadow"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_offset"),new objj_ivar("_blurRadius"),new objj_ivar("_color"),new objj_ivar("_cssString")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("_initWithOffset:blurRadius:color:"),function(_3,_4,_5,_6,_7){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPShadow").super_class},"init");
if(_3){
_offset=_5;
_blurRadius=_6;
_color=_7;
_cssString=objj_msgSend(_color,"cssString")+" "+Math.round(_5.width)+"px "+Math.round(_5.height)+"px "+Math.round(_blurRadius)+"px";
}
return _3;
}
}),new objj_method(sel_getUid("shadowOffset"),function(_8,_9){
with(_8){
return _offset;
}
}),new objj_method(sel_getUid("shadowBlurRadius"),function(_a,_b){
with(_a){
return _blurRadius;
}
}),new objj_method(sel_getUid("shadowColor"),function(_c,_d){
with(_c){
return _color;
}
}),new objj_method(sel_getUid("cssString"),function(_e,_f){
with(_e){
return _cssString;
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("shadowWithOffset:blurRadius:color:"),function(_10,_11,_12,_13,_14){
with(_10){
return objj_msgSend(objj_msgSend(CPShadow,"alloc"),"_initWithOffset:blurRadius:color:",_12,_13,_14);
}
})]);
p;14;CPShadowView.jt;5802;@STATIC;1.0;I;21;Foundation/CPBundle.ji;12;CGGeometry.ji;9;CPImage.ji;13;CPImageView.ji;8;CPView.jt;5697;
objj_executeFile("Foundation/CPBundle.j",NO);
objj_executeFile("CGGeometry.j",YES);
objj_executeFile("CPImage.j",YES);
objj_executeFile("CPImageView.j",YES);
objj_executeFile("CPView.j",YES);
CPLightShadow=0;
CPHeavyShadow=1;
var _1=nil,_2=nil;
var _3=3,_4=3,_5=3,_6=5,_7=7,_8=7,_9=5,_a=5;
var _b=objj_allocateClassPair(CPView,"CPShadowView"),_c=_b.isa;
class_addIvars(_b,[new objj_ivar("_weight")]);
objj_registerClassPair(_b);
class_addMethods(_b,[new objj_method(sel_getUid("initWithFrame:"),function(_d,_e,_f){
with(_d){
_d=objj_msgSendSuper({receiver:_d,super_class:objj_getClass("CPShadowView").super_class},"initWithFrame:",_f);
if(_d){
_weight=CPLightShadow;
objj_msgSend(_d,"setBackgroundColor:",_1);
objj_msgSend(_d,"setHitTests:",NO);
}
return _d;
}
}),new objj_method(sel_getUid("setWeight:"),function(_10,_11,_12){
with(_10){
if(_weight==_12){
return;
}
_weight=_12;
if(_weight==CPLightShadow){
objj_msgSend(_10,"setBackgroundColor:",_1);
}else{
objj_msgSend(_10,"setBackgroundColor:",_2);
}
}
}),new objj_method(sel_getUid("leftInset"),function(_13,_14){
with(_13){
return _weight==CPLightShadow?_3:_7;
}
}),new objj_method(sel_getUid("rightInset"),function(_15,_16){
with(_15){
return _weight==CPLightShadow?_4:_8;
}
}),new objj_method(sel_getUid("topInset"),function(_17,_18){
with(_17){
return _weight==CPLightShadow?_5:_9;
}
}),new objj_method(sel_getUid("bottomInset"),function(_19,_1a){
with(_19){
return _weight==CPLightShadow?_6:_a;
}
}),new objj_method(sel_getUid("horizontalInset"),function(_1b,_1c){
with(_1b){
if(_weight==CPLightShadow){
return _3+_4;
}
return _7+_8;
}
}),new objj_method(sel_getUid("verticalInset"),function(_1d,_1e){
with(_1d){
if(_weight==CPLightShadow){
return _5+_6;
}
return _9+_a;
}
}),new objj_method(sel_getUid("frameForContentFrame:"),function(_1f,_20,_21){
with(_1f){
return objj_msgSend(objj_msgSend(_1f,"class"),"frameForContentFrame:withWeight:",_21,_weight);
}
}),new objj_method(sel_getUid("setFrameForContentFrame:"),function(_22,_23,_24){
with(_22){
objj_msgSend(_22,"setFrame:",objj_msgSend(_22,"frameForContentFrame:",_24));
}
})]);
class_addMethods(_c,[new objj_method(sel_getUid("initialize"),function(_25,_26){
with(_25){
if(_25!=objj_msgSend(CPShadowView,"class")){
return;
}
var _27=objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(_25,"class"));
_1=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPNinePartImage,"alloc"),"initWithImageSlices:",[objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_27,"pathForResource:","CPShadowView/CPShadowViewLightTopLeft.png"),CGSizeMake(9,9)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_27,"pathForResource:","CPShadowView/CPShadowViewLightTop.png"),CGSizeMake(1,9)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_27,"pathForResource:","CPShadowView/CPShadowViewLightTopRight.png"),CGSizeMake(9,9)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_27,"pathForResource:","CPShadowView/CPShadowViewLightLeft.png"),CGSizeMake(9,1)),nil,objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_27,"pathForResource:","CPShadowView/CPShadowViewLightRight.png"),CGSizeMake(9,1)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_27,"pathForResource:","CPShadowView/CPShadowViewLightBottomLeft.png"),CGSizeMake(9,9)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_27,"pathForResource:","CPShadowView/CPShadowViewLightBottom.png"),CGSizeMake(1,9)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_27,"pathForResource:","CPShadowView/CPShadowViewLightBottomRight.png"),CGSizeMake(9,9))]));
_2=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPNinePartImage,"alloc"),"initWithImageSlices:",[objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_27,"pathForResource:","CPShadowView/CPShadowViewHeavyTopLeft.png"),CGSizeMake(17,17)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_27,"pathForResource:","CPShadowView/CPShadowViewHeavyTop.png"),CGSizeMake(1,17)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_27,"pathForResource:","CPShadowView/CPShadowViewHeavyTopRight.png"),CGSizeMake(17,17)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_27,"pathForResource:","CPShadowView/CPShadowViewHeavyLeft.png"),CGSizeMake(17,1)),nil,objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_27,"pathForResource:","CPShadowView/CPShadowViewHeavyRight.png"),CGSizeMake(17,1)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_27,"pathForResource:","CPShadowView/CPShadowViewHeavyBottomLeft.png"),CGSizeMake(17,17)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_27,"pathForResource:","CPShadowView/CPShadowViewHeavyBottom.png"),CGSizeMake(1,17)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_27,"pathForResource:","CPShadowView/CPShadowViewHeavyBottomRight.png"),CGSizeMake(17,17))]));
}
}),new objj_method(sel_getUid("frameForContentFrame:withWeight:"),function(_28,_29,_2a,_2b){
with(_28){
if(_2b==CPLightShadow){
return CGRectMake((_2a.origin.x)-_3,(_2a.origin.y)-_5,(_2a.size.width)+_3+_4,(_2a.size.height)+_5+_6);
}else{
return CGRectMake((_2a.origin.x)-_7,(_2a.origin.y)-_9,(_2a.size.width)+_7+_8,(_2a.size.height)+_9+_a);
}
}
})]);
p;10;CPSlider.jt;11397;@STATIC;1.0;i;11;CPControl.jt;11361;
objj_executeFile("CPControl.j",YES);
CPLinearSlider=0;
CPCircularSlider=1;
var _1=objj_allocateClassPair(CPControl,"CPSlider"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_minValue"),new objj_ivar("_maxValue"),new objj_ivar("_altIncrementValue"),new objj_ivar("_isVertical")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithFrame:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPSlider").super_class},"initWithFrame:",_5);
if(_3){
_minValue=0;
_maxValue=100;
objj_msgSend(_3,"setObjectValue:",50);
objj_msgSend(_3,"setContinuous:",YES);
objj_msgSend(_3,"_recalculateIsVertical");
}
return _3;
}
}),new objj_method(sel_getUid("setMinValue:"),function(_6,_7,_8){
with(_6){
if(_minValue===_8){
return;
}
_minValue=_8;
var _9=objj_msgSend(_6,"doubleValue");
if(_9<_minValue){
objj_msgSend(_6,"setDoubleValue:",_minValue);
}
objj_msgSend(_6,"setNeedsLayout");
objj_msgSend(_6,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("minValue"),function(_a,_b){
with(_a){
return _minValue;
}
}),new objj_method(sel_getUid("setMaxValue:"),function(_c,_d,_e){
with(_c){
if(_maxValue===_e){
return;
}
_maxValue=_e;
var _f=objj_msgSend(_c,"doubleValue");
if(_f>_maxValue){
objj_msgSend(_c,"setDoubleValue:",_maxValue);
}
objj_msgSend(_c,"setNeedsLayout");
objj_msgSend(_c,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("maxValue"),function(_10,_11){
with(_10){
return _maxValue;
}
}),new objj_method(sel_getUid("setObjectValue:"),function(_12,_13,_14){
with(_12){
objj_msgSendSuper({receiver:_12,super_class:objj_getClass("CPSlider").super_class},"setObjectValue:",MIN(MAX(_14,_minValue),_maxValue));
objj_msgSend(_12,"setNeedsLayout");
objj_msgSend(_12,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("setSliderType:"),function(_15,_16,_17){
with(_15){
if(_17===CPCircularSlider){
objj_msgSend(_15,"setThemeState:",CPThemeStateCircular);
}else{
objj_msgSend(_15,"unsetThemeState:",CPThemeStateCircular);
}
}
}),new objj_method(sel_getUid("sliderType"),function(_18,_19){
with(_18){
return objj_msgSend(_18,"hasThemeState:",CPThemeStateCircular)?CPCircularSlider:CPLinearSlider;
}
}),new objj_method(sel_getUid("trackRectForBounds:"),function(_1a,_1b,_1c){
with(_1a){
if(objj_msgSend(_1a,"hasThemeState:",CPThemeStateCircular)){
var _1d=CGRectCreateCopy(_1c);
_1c.size.width=MIN(_1c.size.width,_1c.size.height);
_1c.size.height=_1c.size.width;
if(_1c.size.width<_1d.size.width){
_1c.origin.x+=(_1d.size.width-_1c.size.width)/2;
}else{
_1c.origin.y+=(_1d.size.height-_1c.size.height)/2;
}
}else{
var _1e=objj_msgSend(_1a,"currentValueForThemeAttribute:","track-width");
if(_1e<=0){
return {origin:{x:0,y:0},size:{width:0,height:0}};
}
if(objj_msgSend(_1a,"isVertical")){
_1c.origin.x=((_1c.size.width)-_1e)/2;
_1c.size.width=_1e;
}else{
_1c.origin.y=((_1c.size.height)-_1e)/2;
_1c.size.height=_1e;
}
}
return _1c;
}
}),new objj_method(sel_getUid("knobRectForBounds:"),function(_1f,_20,_21){
with(_1f){
var _22=objj_msgSend(_1f,"currentValueForThemeAttribute:","knob-size");
if(_22.width<=0||_22.height<=0){
return {origin:{x:0,y:0},size:{width:0,height:0}};
}
var _23={origin:{x:0,y:0},size:{width:_22.width,height:_22.height}},_24=objj_msgSend(_1f,"trackRectForBounds:",_21);
if(!_24||(_24.size.width<=0||_24.size.height<=0)){
_24=_21;
}
if(objj_msgSend(_1f,"hasThemeState:",CPThemeStateCircular)){
var _25=3*PI_2-(1-objj_msgSend(_1f,"doubleValue")-_minValue)/(_maxValue-_minValue)*PI2,_26=CGRectGetWidth(_24)/2-8;
_23.origin.x=_26*COS(_25)+CGRectGetMidX(_24)-3;
_23.origin.y=_26*SIN(_25)+CGRectGetMidY(_24)-2;
}else{
if(objj_msgSend(_1f,"isVertical")){
_23.origin.x=(_24.origin.x+(_24.size.width)/2)-_22.width/2;
_23.origin.y=((objj_msgSend(_1f,"doubleValue")-_minValue)/(_maxValue-_minValue))*((_24.size.height)-_22.height);
}else{
_23.origin.x=((objj_msgSend(_1f,"doubleValue")-_minValue)/(_maxValue-_minValue))*((_24.size.width)-_22.width);
_23.origin.y=(_24.origin.y+(_24.size.height)/2)-_22.height/2;
}
}
return _23;
}
}),new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"),function(_27,_28,_29){
with(_27){
if(_29==="track-view"){
return objj_msgSend(_27,"trackRectForBounds:",objj_msgSend(_27,"bounds"));
}else{
if(_29==="knob-view"){
return objj_msgSend(_27,"knobRectForBounds:",objj_msgSend(_27,"bounds"));
}
}
return objj_msgSendSuper({receiver:_27,super_class:objj_getClass("CPSlider").super_class},"rectForEphemeralSubviewNamed:",_29);
}
}),new objj_method(sel_getUid("createEphemeralSubviewNamed:"),function(_2a,_2b,_2c){
with(_2a){
if(_2c==="track-view"||_2c==="knob-view"){
var _2d=objj_msgSend(objj_msgSend(CPView,"alloc"),"init");
objj_msgSend(_2d,"setHitTests:",NO);
return _2d;
}
return objj_msgSendSuper({receiver:_2a,super_class:objj_getClass("CPSlider").super_class},"createEphemeralSubviewNamed:",_2c);
}
}),new objj_method(sel_getUid("setAltIncrementValue:"),function(_2e,_2f,_30){
with(_2e){
_altIncrementValue=_30;
}
}),new objj_method(sel_getUid("altIncrementValue"),function(_31,_32){
with(_31){
return _altIncrementValue;
}
}),new objj_method(sel_getUid("setFrameSize:"),function(_33,_34,_35){
with(_33){
objj_msgSendSuper({receiver:_33,super_class:objj_getClass("CPSlider").super_class},"setFrameSize:",_35);
objj_msgSend(_33,"_recalculateIsVertical");
}
}),new objj_method(sel_getUid("_recalculateIsVertical"),function(_36,_37){
with(_36){
var _38=objj_msgSend(_36,"bounds"),_39=(_38.size.width),_3a=(_38.size.height);
_isVertical=_39<_3a?1:(_39>_3a?0:-1);
if(_isVertical===1){
objj_msgSend(_36,"setThemeState:",CPThemeStateVertical);
}else{
if(_isVertical===0){
objj_msgSend(_36,"unsetThemeState:",CPThemeStateVertical);
}
}
}
}),new objj_method(sel_getUid("isVertical"),function(_3b,_3c){
with(_3b){
return _isVertical;
}
}),new objj_method(sel_getUid("layoutSubviews"),function(_3d,_3e){
with(_3d){
var _3f=objj_msgSend(_3d,"layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:","track-view",CPWindowBelow,"knob-view");
if(_3f){
objj_msgSend(_3f,"setBackgroundColor:",objj_msgSend(_3d,"currentValueForThemeAttribute:","track-color"));
}
var _40=objj_msgSend(_3d,"layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:","knob-view",CPWindowAbove,"track-view");
if(_40){
objj_msgSend(_40,"setBackgroundColor:",objj_msgSend(_3d,"currentValueForThemeAttribute:","knob-color"));
}
}
}),new objj_method(sel_getUid("tracksMouseOutsideOfFrame"),function(_41,_42){
with(_41){
return YES;
}
}),new objj_method(sel_getUid("_valueAtPoint:"),function(_43,_44,_45){
with(_43){
var _46=objj_msgSend(_43,"bounds"),_47=objj_msgSend(_43,"knobRectForBounds:",_46),_48=objj_msgSend(_43,"trackRectForBounds:",_46);
if(objj_msgSend(_43,"hasThemeState:",CPThemeStateCircular)){
var _49=(_47.size.width);
_48.origin.x+=_49/2;
_48.size.width-=_49;
var _4a=objj_msgSend(_43,"minValue"),dx=_45.x-(_48.origin.x+(_48.size.width)/2),dy=_45.y-(_48.origin.y+(_48.size.height)/2);
return MAX(0,MIN(1,1-(3*PI_2-ATAN2(dy,dx))%PI2/PI2))*(objj_msgSend(_43,"maxValue")-_4a)+_4a;
}else{
if(objj_msgSend(_43,"isVertical")){
var _4b=(_47.size.height);
_48.origin.y+=_4b/2;
_48.size.height-=_4b;
var _4a=objj_msgSend(_43,"minValue");
return MAX(0,MIN(1,(_45.y-(_48.origin.y))/(_48.size.height)))*(objj_msgSend(_43,"maxValue")-_4a)+_4a;
}else{
var _49=(_47.size.width);
_48.origin.x+=_49/2;
_48.size.width-=_49;
var _4a=objj_msgSend(_43,"minValue");
return MAX(0,MIN(1,(_45.x-(_48.origin.x))/(_48.size.width)))*(objj_msgSend(_43,"maxValue")-_4a)+_4a;
}
}
}
}),new objj_method(sel_getUid("startTrackingAt:"),function(_4c,_4d,_4e){
with(_4c){
var _4f=objj_msgSend(_4c,"bounds"),_50=objj_msgSend(_4c,"knobRectForBounds:",{origin:{x:_4f.origin.x,y:_4f.origin.y},size:{width:_4f.size.width,height:_4f.size.height}});
if((_4e.x>=(_50.origin.x)&&_4e.y>=(_50.origin.y)&&_4e.x<(_50.origin.x+_50.size.width)&&_4e.y<(_50.origin.y+_50.size.height))){
_dragOffset={width:(_50.origin.x+(_50.size.width)/2)-_4e.x,height:(_50.origin.y+(_50.size.height)/2)-_4e.y};
}else{
var _51=objj_msgSend(_4c,"trackRectForBounds:",_4f);
if(_51&&(_4e.x>=(_51.origin.x)&&_4e.y>=(_51.origin.y)&&_4e.x<(_51.origin.x+_51.size.width)&&_4e.y<(_51.origin.y+_51.size.height))){
_dragOffset={width:0,height:0};
objj_msgSend(_4c,"setObjectValue:",objj_msgSend(_4c,"_valueAtPoint:",_4e));
}else{
return NO;
}
}
objj_msgSend(_4c,"setHighlighted:",YES);
objj_msgSend(_4c,"setNeedsLayout");
objj_msgSend(_4c,"setNeedsDisplay:",YES);
return YES;
}
}),new objj_method(sel_getUid("continueTracking:at:"),function(_52,_53,_54,_55){
with(_52){
objj_msgSend(_52,"setObjectValue:",objj_msgSend(_52,"_valueAtPoint:",{x:_55.x+_dragOffset.width,y:_55.y+_dragOffset.height}));
return YES;
}
}),new objj_method(sel_getUid("stopTracking:at:mouseIsUp:"),function(_56,_57,_58,_59,_5a){
with(_56){
objj_msgSend(_56,"setHighlighted:",NO);
if(objj_msgSend(_target,"respondsToSelector:",sel_getUid("sliderDidFinish:"))){
objj_msgSend(_target,"sliderDidFinish:",_56);
}
objj_msgSend(_56,"setNeedsLayout");
objj_msgSend(_56,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("setContinuous:"),function(_5b,_5c,_5d){
with(_5b){
if(_5d){
_sendActionOn|=CPLeftMouseDraggedMask;
}else{
_sendActionOn&=~CPLeftMouseDraggedMask;
}
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("themeClass"),function(_5e,_5f){
with(_5e){
return "slider";
}
}),new objj_method(sel_getUid("themeAttributes"),function(_60,_61){
with(_60){
return objj_msgSend(CPDictionary,"dictionaryWithObjects:forKeys:",[objj_msgSend(CPNull,"null"),{width:0,height:0},0,objj_msgSend(CPNull,"null")],["knob-color","knob-size","track-width","track-color"]);
}
})]);
var _62="CPSliderMinValueKey",_63="CPSliderMaxValueKey",_64="CPSliderAltIncrValueKey";
var _1=objj_getClass("CPSlider");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPSlider\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_65,_66,_67){
with(_65){
_minValue=objj_msgSend(_67,"decodeDoubleForKey:",_62);
_maxValue=objj_msgSend(_67,"decodeDoubleForKey:",_63);
_65=objj_msgSendSuper({receiver:_65,super_class:objj_getClass("CPSlider").super_class},"initWithCoder:",_67);
if(_65){
_altIncrementValue=objj_msgSend(_67,"decodeDoubleForKey:",_64);
objj_msgSend(_65,"setContinuous:",YES);
objj_msgSend(_65,"_recalculateIsVertical");
objj_msgSend(_65,"setNeedsLayout");
objj_msgSend(_65,"setNeedsDisplay:",YES);
}
return _65;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_68,_69,_6a){
with(_68){
objj_msgSendSuper({receiver:_68,super_class:objj_getClass("CPSlider").super_class},"encodeWithCoder:",_6a);
objj_msgSend(_6a,"encodeDouble:forKey:",_minValue,_62);
objj_msgSend(_6a,"encodeDouble:forKey:",_maxValue,_63);
objj_msgSend(_6a,"encodeDouble:forKey:",_altIncrementValue,_64);
}
})]);
var _1=objj_getClass("CPSlider");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPSlider\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("value"),function(_6b,_6c){
with(_6b){
CPLog.warn("[CPSlider value] is deprecated, use doubleValue or objectValue instead.");
return objj_msgSend(_6b,"doubleValue");
}
}),new objj_method(sel_getUid("setValue:"),function(_6d,_6e,_6f){
with(_6d){
CPLog.warn("[CPSlider setValue:] is deprecated, use setDoubleValue: or setObjectValue: instead.");
objj_msgSend(_6d,"setObjectValue:",_6f);
}
})]);
p;21;CPSliderColorPicker.jt;9407;@STATIC;1.0;i;15;CPColorPicker.jt;9368;
objj_executeFile("CPColorPicker.j",YES);
var _1=objj_allocateClassPair(CPColorPicker,"CPSliderColorPicker"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_contentView"),new objj_ivar("_redSlider"),new objj_ivar("_greenSlider"),new objj_ivar("_blueSlider"),new objj_ivar("_hueSlider"),new objj_ivar("_saturationSlider"),new objj_ivar("_brightnessSlider"),new objj_ivar("_rgbLabel"),new objj_ivar("_hsbLabel"),new objj_ivar("_redLabel"),new objj_ivar("_greenLabel"),new objj_ivar("_blueLabel"),new objj_ivar("_hueLabel"),new objj_ivar("_saturationLabel"),new objj_ivar("_brightnessLabel"),new objj_ivar("_hexLabel")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithPickerMask:colorPanel:"),function(_3,_4,_5,_6){
with(_3){
return objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPSliderColorPicker").super_class},"initWithPickerMask:colorPanel:",_5,_6);
}
}),new objj_method(sel_getUid("initView"),function(_7,_8){
with(_7){
aFrame=CPRectMake(0,0,CPColorPickerViewWidth,CPColorPickerViewHeight);
_contentView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",aFrame);
objj_msgSend(_contentView,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
_rgbLabel=objj_msgSend(objj_msgSend(CPTextField,"alloc"),"initWithFrame:",CPRectMake(0,10,100,20));
objj_msgSend(_rgbLabel,"setStringValue:","Red, Green, Blue");
objj_msgSend(_rgbLabel,"setTextColor:",objj_msgSend(CPColor,"blackColor"));
_redLabel=objj_msgSend(objj_msgSend(CPTextField,"alloc"),"initWithFrame:",CPRectMake(0,35,15,20));
objj_msgSend(_redLabel,"setStringValue:","R");
objj_msgSend(_redLabel,"setTextColor:",objj_msgSend(CPColor,"blackColor"));
_redSlider=objj_msgSend(objj_msgSend(CPSlider,"alloc"),"initWithFrame:",CPRectMake(15,35,aFrame.size.width-70,20));
objj_msgSend(_redSlider,"setMaxValue:",1);
objj_msgSend(_redSlider,"setMinValue:",0);
objj_msgSend(_redSlider,"setTarget:",_7);
objj_msgSend(_redSlider,"setAction:",sel_getUid("sliderChanged:"));
objj_msgSend(_redSlider,"setAutoresizingMask:",CPViewWidthSizable);
_greenLabel=objj_msgSend(objj_msgSend(CPTextField,"alloc"),"initWithFrame:",CPRectMake(0,58,15,20));
objj_msgSend(_greenLabel,"setStringValue:","G");
objj_msgSend(_greenLabel,"setTextColor:",objj_msgSend(CPColor,"blackColor"));
_greenSlider=objj_msgSend(objj_msgSend(CPSlider,"alloc"),"initWithFrame:",CPRectMake(15,58,aFrame.size.width-70,20));
objj_msgSend(_greenSlider,"setMaxValue:",1);
objj_msgSend(_greenSlider,"setMinValue:",0);
objj_msgSend(_greenSlider,"setTarget:",_7);
objj_msgSend(_greenSlider,"setAction:",sel_getUid("sliderChanged:"));
objj_msgSend(_greenSlider,"setAutoresizingMask:",CPViewWidthSizable);
_blueLabel=objj_msgSend(objj_msgSend(CPTextField,"alloc"),"initWithFrame:",CPRectMake(0,81,15,20));
objj_msgSend(_blueLabel,"setStringValue:","B");
objj_msgSend(_blueLabel,"setTextColor:",objj_msgSend(CPColor,"blackColor"));
_blueSlider=objj_msgSend(objj_msgSend(CPSlider,"alloc"),"initWithFrame:",CPRectMake(15,81,aFrame.size.width-70,20));
objj_msgSend(_blueSlider,"setMaxValue:",1);
objj_msgSend(_blueSlider,"setMinValue:",0);
objj_msgSend(_blueSlider,"setTarget:",_7);
objj_msgSend(_blueSlider,"setAction:",sel_getUid("sliderChanged:"));
objj_msgSend(_blueSlider,"setAutoresizingMask:",CPViewWidthSizable);
_hsbLabel=objj_msgSend(objj_msgSend(CPTextField,"alloc"),"initWithFrame:",CPRectMake(0,120,190,20));
objj_msgSend(_hsbLabel,"setStringValue:","Hue, Saturation, Brightness");
objj_msgSend(_hsbLabel,"setTextColor:",objj_msgSend(CPColor,"blackColor"));
_hueLabel=objj_msgSend(objj_msgSend(CPTextField,"alloc"),"initWithFrame:",CPRectMake(0,145,15,20));
objj_msgSend(_hueLabel,"setStringValue:","H");
objj_msgSend(_hueLabel,"setTextColor:",objj_msgSend(CPColor,"blackColor"));
_hueSlider=objj_msgSend(objj_msgSend(CPSlider,"alloc"),"initWithFrame:",CPRectMake(15,145,aFrame.size.width-70,20));
objj_msgSend(_hueSlider,"setMaxValue:",359);
objj_msgSend(_hueSlider,"setMinValue:",0);
objj_msgSend(_hueSlider,"setTarget:",_7);
objj_msgSend(_hueSlider,"setAction:",sel_getUid("sliderChanged:"));
objj_msgSend(_hueSlider,"setAutoresizingMask:",CPViewWidthSizable);
_saturationLabel=objj_msgSend(objj_msgSend(CPTextField,"alloc"),"initWithFrame:",CPRectMake(0,168,15,20));
objj_msgSend(_saturationLabel,"setStringValue:","S");
objj_msgSend(_saturationLabel,"setTextColor:",objj_msgSend(CPColor,"blackColor"));
_saturationSlider=objj_msgSend(objj_msgSend(CPSlider,"alloc"),"initWithFrame:",CPRectMake(15,168,aFrame.size.width-70,20));
objj_msgSend(_saturationSlider,"setMaxValue:",100);
objj_msgSend(_saturationSlider,"setMinValue:",0);
objj_msgSend(_saturationSlider,"setTarget:",_7);
objj_msgSend(_saturationSlider,"setAction:",sel_getUid("sliderChanged:"));
objj_msgSend(_saturationSlider,"setAutoresizingMask:",CPViewWidthSizable);
_brightnessLabel=objj_msgSend(objj_msgSend(CPTextField,"alloc"),"initWithFrame:",CPRectMake(0,191,15,20));
objj_msgSend(_brightnessLabel,"setStringValue:","B");
objj_msgSend(_brightnessLabel,"setTextColor:",objj_msgSend(CPColor,"blackColor"));
_brightnessSlider=objj_msgSend(objj_msgSend(CPSlider,"alloc"),"initWithFrame:",CPRectMake(15,191,aFrame.size.width-70,20));
objj_msgSend(_brightnessSlider,"setMaxValue:",100);
objj_msgSend(_brightnessSlider,"setMinValue:",0);
objj_msgSend(_brightnessSlider,"setTarget:",_7);
objj_msgSend(_brightnessSlider,"setAction:",sel_getUid("sliderChanged:"));
objj_msgSend(_brightnessSlider,"setAutoresizingMask:",CPViewWidthSizable);
_hexLabel=objj_msgSend(objj_msgSend(CPTextField,"alloc"),"initWithFrame:",CPRectMake(0,230,30,20));
objj_msgSend(_hexLabel,"setStringValue:","Hex");
objj_msgSend(_hexLabel,"setTextColor:",objj_msgSend(CPColor,"blackColor"));
objj_msgSend(_contentView,"addSubview:",_rgbLabel);
objj_msgSend(_contentView,"addSubview:",_redLabel);
objj_msgSend(_contentView,"addSubview:",_greenLabel);
objj_msgSend(_contentView,"addSubview:",_blueLabel);
objj_msgSend(_contentView,"addSubview:",_redSlider);
objj_msgSend(_contentView,"addSubview:",_greenSlider);
objj_msgSend(_contentView,"addSubview:",_blueSlider);
objj_msgSend(_contentView,"addSubview:",_hsbLabel);
objj_msgSend(_contentView,"addSubview:",_hueLabel);
objj_msgSend(_contentView,"addSubview:",_saturationLabel);
objj_msgSend(_contentView,"addSubview:",_brightnessLabel);
objj_msgSend(_contentView,"addSubview:",_hueSlider);
objj_msgSend(_contentView,"addSubview:",_saturationSlider);
objj_msgSend(_contentView,"addSubview:",_brightnessSlider);
objj_msgSend(_contentView,"addSubview:",_hexLabel);
}
}),new objj_method(sel_getUid("provideNewView:"),function(_9,_a,_b){
with(_9){
if(_b){
objj_msgSend(_9,"initView");
}
return _contentView;
}
}),new objj_method(sel_getUid("currentMode"),function(_c,_d){
with(_c){
return CPSliderColorPickerMode;
}
}),new objj_method(sel_getUid("supportsMode:"),function(_e,_f,_10){
with(_e){
return (_10==CPSliderColorPickerMode)?YES:NO;
}
}),new objj_method(sel_getUid("sliderChanged:"),function(_11,_12,_13){
with(_11){
var _14,_15=objj_msgSend(_11,"colorPanel"),_16=objj_msgSend(_15,"opacity");
switch(_13){
case _hueSlider:
case _saturationSlider:
case _brightnessSlider:
_14=objj_msgSend(CPColor,"colorWithHue:saturation:brightness:alpha:",objj_msgSend(_hueSlider,"floatValue"),objj_msgSend(_saturationSlider,"floatValue"),objj_msgSend(_brightnessSlider,"floatValue"),_16);
objj_msgSend(_11,"updateRGBSliders:",_14);
break;
case _redSlider:
case _greenSlider:
case _blueSlider:
_14=objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",objj_msgSend(_redSlider,"floatValue"),objj_msgSend(_greenSlider,"floatValue"),objj_msgSend(_blueSlider,"floatValue"),_16);
objj_msgSend(_11,"updateHSBSliders:",_14);
break;
}
objj_msgSend(_11,"updateLabels");
objj_msgSend(_11,"updateHex:",_14);
objj_msgSend(_15,"setColor:",_14);
}
}),new objj_method(sel_getUid("setColor:"),function(_17,_18,_19){
with(_17){
objj_msgSend(_17,"updateRGBSliders:",_19);
objj_msgSend(_17,"updateHSBSliders:",_19);
objj_msgSend(_17,"updateHex:",_19);
objj_msgSend(_17,"updateLabels");
}
}),new objj_method(sel_getUid("updateHSBSliders:"),function(_1a,_1b,_1c){
with(_1a){
var hsb=objj_msgSend(_1c,"hsbComponents");
objj_msgSend(_hueSlider,"setFloatValue:",hsb[0]);
objj_msgSend(_saturationSlider,"setFloatValue:",hsb[1]);
objj_msgSend(_brightnessSlider,"setFloatValue:",hsb[2]);
}
}),new objj_method(sel_getUid("updateHex:"),function(_1d,_1e,_1f){
with(_1d){
}
}),new objj_method(sel_getUid("updateRGBSliders:"),function(_20,_21,_22){
with(_20){
var rgb=objj_msgSend(_22,"components");
objj_msgSend(_redSlider,"setFloatValue:",rgb[0]);
objj_msgSend(_greenSlider,"setFloatValue:",rgb[1]);
objj_msgSend(_blueSlider,"setFloatValue:",rgb[2]);
}
}),new objj_method(sel_getUid("updateLabels"),function(_23,_24){
with(_23){
}
}),new objj_method(sel_getUid("provideNewButtonImage"),function(_25,_26){
with(_25){
return objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(objj_msgSend(CPBundle,"bundleForClass:",CPColorPicker),"pathForResource:","slider_button.png"),CGSizeMake(32,32));
}
}),new objj_method(sel_getUid("provideNewAlternateButtonImage"),function(_27,_28){
with(_27){
return objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(objj_msgSend(CPBundle,"bundleForClass:",CPColorPicker),"pathForResource:","slider_button_h.png"),CGSizeMake(32,32));
}
})]);
p;13;CPSplitView.jt;17936;@STATIC;1.0;i;9;CPImage.ji;8;CPView.jt;17891;
objj_executeFile("CPImage.j",YES);
objj_executeFile("CPView.j",YES);
CPSplitViewDidResizeSubviewsNotification="CPSplitViewDidResizeSubviewsNotification";
CPSplitViewWillResizeSubviewsNotification="CPSplitViewWillResizeSubviewsNotification";
var _1=nil,_2=nil;
var _3=objj_allocateClassPair(CPView,"CPSplitView"),_4=_3.isa;
class_addIvars(_3,[new objj_ivar("_delegate"),new objj_ivar("_isVertical"),new objj_ivar("_isPaneSplitter"),new objj_ivar("_currentDivider"),new objj_ivar("_initialOffset"),new objj_ivar("_originComponent"),new objj_ivar("_sizeComponent"),new objj_ivar("_DOMDividerElements"),new objj_ivar("_dividerImagePath"),new objj_ivar("_drawingDivider"),new objj_ivar("_needsResizeSubviews")]);
objj_registerClassPair(_3);
class_addMethods(_3,[new objj_method(sel_getUid("initWithFrame:"),function(_5,_6,_7){
with(_5){
if(_5=objj_msgSendSuper({receiver:_5,super_class:objj_getClass("CPSplitView").super_class},"initWithFrame:",_7)){
_currentDivider=CPNotFound;
_DOMDividerElements=[];
objj_msgSend(_5,"_setVertical:",YES);
}
return _5;
}
}),new objj_method(sel_getUid("dividerThickness"),function(_8,_9){
with(_8){
return _isPaneSplitter?1:10;
}
}),new objj_method(sel_getUid("isVertical"),function(_a,_b){
with(_a){
return _isVertical;
}
}),new objj_method(sel_getUid("setVertical:"),function(_c,_d,_e){
with(_c){
if(!objj_msgSend(_c,"_setVertical:",_e)){
return;
}
var _f=objj_msgSend(_c,"frame"),_10=objj_msgSend(_c,"dividerThickness");
objj_msgSend(_c,"_postNotificationWillResize");
var _11=ROUND((_f.size[_sizeComponent]-_10*(_subviews.length-1))/_subviews.length),_12=0,_13=_subviews.length;
if(objj_msgSend(_c,"isVertical")){
for(;_12<_13;++_12){
objj_msgSend(_subviews[_12],"setFrame:",CGRectMake(ROUND((_11+_10)*_12),0,_11,_f.size.height));
}
}else{
for(;_12<_13;++_12){
objj_msgSend(_subviews[_12],"setFrame:",CGRectMake(0,ROUND((_11+_10)*_12),_f.size.width,_11));
}
}
objj_msgSend(_c,"setNeedsDisplay:",YES);
objj_msgSend(_c,"_postNotificationDidResize");
}
}),new objj_method(sel_getUid("_setVertical:"),function(_14,_15,_16){
with(_14){
var _17=(_isVertical!=_16);
_isVertical=_16;
_originComponent=objj_msgSend(_14,"isVertical")?"x":"y";
_sizeComponent=objj_msgSend(_14,"isVertical")?"width":"height";
_dividerImagePath=objj_msgSend(_14,"isVertical")?objj_msgSend(_2,"filename"):objj_msgSend(_1,"filename");
return _17;
}
}),new objj_method(sel_getUid("isPaneSplitter"),function(_18,_19){
with(_18){
return _isPaneSplitter;
}
}),new objj_method(sel_getUid("setIsPaneSplitter:"),function(_1a,_1b,_1c){
with(_1a){
if(_isPaneSplitter==_1c){
return;
}
_isPaneSplitter=_1c;
if(_DOMDividerElements[_drawingDivider]){
objj_msgSend(_1a,"_setupDOMDivider");
}
_needsResizeSubviews=YES;
objj_msgSend(_1a,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("didAddSubview:"),function(_1d,_1e,_1f){
with(_1d){
_needsResizeSubviews=YES;
}
}),new objj_method(sel_getUid("isSubviewCollapsed:"),function(_20,_21,_22){
with(_20){
return objj_msgSend(_22,"frame").size[_sizeComponent]<1?YES:NO;
}
}),new objj_method(sel_getUid("rectOfDividerAtIndex:"),function(_23,_24,_25){
with(_23){
var _26=objj_msgSend(_subviews[_25],"frame"),_27=CGRectMakeZero();
_27.size=objj_msgSend(_23,"frame").size;
_27.size[_sizeComponent]=objj_msgSend(_23,"dividerThickness");
_27.origin[_originComponent]=_26.origin[_originComponent]+_26.size[_sizeComponent];
return _27;
}
}),new objj_method(sel_getUid("effectiveRectOfDividerAtIndex:"),function(_28,_29,_2a){
with(_28){
var _2b=objj_msgSend(_28,"rectOfDividerAtIndex:",_2a);
var _2c=2;
_2b.size[_sizeComponent]+=_2c*2;
_2b.origin[_originComponent]-=_2c;
return _2b;
}
}),new objj_method(sel_getUid("drawRect:"),function(_2d,_2e,_2f){
with(_2d){
var _30=objj_msgSend(_subviews,"count")-1;
while((_30--)>0){
_drawingDivider=_30;
objj_msgSend(_2d,"drawDividerInRect:",objj_msgSend(_2d,"rectOfDividerAtIndex:",_30));
}
}
}),new objj_method(sel_getUid("drawDividerInRect:"),function(_31,_32,_33){
with(_31){
if(!_DOMDividerElements[_drawingDivider]){
_DOMDividerElements[_drawingDivider]=document.createElement("div");
if(_isVertical){
_DOMDividerElements[_drawingDivider].style.cursor=objj_msgSend(objj_msgSend(CPCursor,"resizeLeftRightCursor"),"_cssString");
}else{
_DOMDividerElements[_drawingDivider].style.cursor=objj_msgSend(objj_msgSend(CPCursor,"resizeUpDownCursor"),"_cssString");
}
_DOMDividerElements[_drawingDivider].style.position="absolute";
_DOMDividerElements[_drawingDivider].style.backgroundRepeat="repeat";
_DOMElement.appendChild(_DOMDividerElements[_drawingDivider]);
objj_msgSend(_31,"_setupDOMDivider");
}
if(NULL){
var _34=_CGPointApplyAffineTransform(CGPointMake((_33.origin.x),(_33.origin.y)),NULL);
}else{
var _34={x:(_33.origin.x),y:(_33.origin.y)};
}
_DOMDividerElements[_drawingDivider].style.left=ROUND(_34.x)+"px";
_DOMDividerElements[_drawingDivider].style.top=ROUND(_34.y)+"px";
_DOMDividerElements[_drawingDivider].style.width=MAX(0,ROUND((_33.size.width)))+"px";
_DOMDividerElements[_drawingDivider].style.height=MAX(0,ROUND((_33.size.height)))+"px";
}
}),new objj_method(sel_getUid("_setupDOMDivider"),function(_35,_36){
with(_35){
if(_isPaneSplitter){
_DOMDividerElements[_drawingDivider].style.backgroundColor="#A5A5A5";
_DOMDividerElements[_drawingDivider].style.backgroundImage="";
}else{
_DOMDividerElements[_drawingDivider].style.backgroundColor="";
_DOMDividerElements[_drawingDivider].style.backgroundImage="url('"+_dividerImagePath+"')";
}
}
}),new objj_method(sel_getUid("viewWillDraw"),function(_37,_38){
with(_37){
objj_msgSend(_37,"_adjustSubviewsWithCalculatedSize");
}
}),new objj_method(sel_getUid("_adjustSubviewsWithCalculatedSize"),function(_39,_3a){
with(_39){
if(!_needsResizeSubviews){
return;
}
_needsResizeSubviews=NO;
var _3b=objj_msgSend(_39,"subviews"),_3c=_3b.length,_3d=CGSizeMakeZero();
if(objj_msgSend(_39,"isVertical")){
_3d.width+=objj_msgSend(_39,"dividerThickness")*(_3c-1);
_3d.height=CGRectGetHeight(objj_msgSend(_39,"frame"));
}else{
_3d.width=CGRectGetWidth(objj_msgSend(_39,"frame"));
_3d.height+=objj_msgSend(_39,"dividerThickness")*(_3c-1);
}
while(_3c--){
_3d[_sizeComponent]+=objj_msgSend(_3b[_3c],"frame").size[_sizeComponent];
}
objj_msgSend(_39,"resizeSubviewsWithOldSize:",_3d);
}
}),new objj_method(sel_getUid("cursorAtPoint:hitDividerAtIndex:"),function(_3e,_3f,_40,_41){
with(_3e){
var _42=objj_msgSend(_subviews[_41],"frame"),_43=_42.origin[_originComponent]+_42.size[_sizeComponent],_44=objj_msgSend(_3e,"effectiveRectOfDividerAtIndex:",_41),_45=null;
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("splitView:effectiveRect:forDrawnRect:ofDividerAtIndex:"))){
_44=objj_msgSend(_delegate,"splitView:effectiveRect:forDrawnRect:ofDividerAtIndex:",_3e,_44,_44,_41);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("splitView:additionalEffectiveRectOfDividerAtIndex:"))){
_45=objj_msgSend(_delegate,"splitView:additionalEffectiveRectOfDividerAtIndex:",_3e,_41);
}
return CGRectContainsPoint(_44,_40)||(_45&&CGRectContainsPoint(_45,_40));
}
}),new objj_method(sel_getUid("hitTest:"),function(_46,_47,_48){
with(_46){
if(objj_msgSend(_46,"isHidden")||!objj_msgSend(_46,"hitTests")||!CGRectContainsPoint(objj_msgSend(_46,"frame"),_48)){
return nil;
}
var _49=objj_msgSend(_46,"convertPoint:fromView:",_48,objj_msgSend(_46,"superview"));
var _4a=objj_msgSend(_subviews,"count")-1;
for(var i=0;i<_4a;i++){
if(objj_msgSend(_46,"cursorAtPoint:hitDividerAtIndex:",_49,i)){
return _46;
}
}
return objj_msgSendSuper({receiver:_46,super_class:objj_getClass("CPSplitView").super_class},"hitTest:",_48);
}
}),new objj_method(sel_getUid("trackDivider:"),function(_4b,_4c,_4d){
with(_4b){
var _4e=objj_msgSend(_4d,"type");
if(_4e==CPLeftMouseUp){
if(_currentDivider!=CPNotFound){
_currentDivider=CPNotFound;
objj_msgSend(_4b,"_postNotificationDidResize");
}
return;
}
if(_4e==CPLeftMouseDown){
var _4f=objj_msgSend(_4b,"convertPoint:fromView:",objj_msgSend(_4d,"locationInWindow"),nil);
_currentDivider=CPNotFound;
var _50=objj_msgSend(_subviews,"count")-1;
for(var i=0;i<_50;i++){
var _51=objj_msgSend(_subviews[i],"frame"),_52=_51.origin[_originComponent]+_51.size[_sizeComponent];
if(objj_msgSend(_4b,"cursorAtPoint:hitDividerAtIndex:",_4f,i)){
if(objj_msgSend(_4d,"clickCount")==2&&objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("splitView:canCollapseSubview:"))&&objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("splitView:shouldCollapseSubview:forDoubleClickOnDividerAtIndex:"))){
var _53=objj_msgSend(_4b,"minPossiblePositionOfDividerAtIndex:",i),_54=objj_msgSend(_4b,"maxPossiblePositionOfDividerAtIndex:",i);
if(objj_msgSend(_delegate,"splitView:canCollapseSubview:",_4b,_subviews[i])&&objj_msgSend(_delegate,"splitView:shouldCollapseSubview:forDoubleClickOnDividerAtIndex:",_4b,_subviews[i],i)){
if(objj_msgSend(_4b,"isSubviewCollapsed:",_subviews[i])){
objj_msgSend(_4b,"setPosition:ofDividerAtIndex:",(_53+(_54-_53)/2),i);
}else{
objj_msgSend(_4b,"setPosition:ofDividerAtIndex:",_53,i);
}
}else{
if(objj_msgSend(_delegate,"splitView:canCollapseSubview:",_4b,_subviews[i+1])&&objj_msgSend(_delegate,"splitView:shouldCollapseSubview:forDoubleClickOnDividerAtIndex:",_4b,_subviews[i+1],i)){
if(objj_msgSend(_4b,"isSubviewCollapsed:",_subviews[i+1])){
objj_msgSend(_4b,"setPosition:ofDividerAtIndex:",(_53+(_54-_53)/2),i);
}else{
objj_msgSend(_4b,"setPosition:ofDividerAtIndex:",_54,i);
}
}
}
}else{
_currentDivider=i;
_initialOffset=_52-_4f[_originComponent];
objj_msgSend(_4b,"_postNotificationWillResize");
}
}
}
if(_currentDivider===CPNotFound){
return;
}
}else{
if(_4e==CPLeftMouseDragged&&_currentDivider!=CPNotFound){
var _4f=objj_msgSend(_4b,"convertPoint:fromView:",objj_msgSend(_4d,"locationInWindow"),nil);
objj_msgSend(_4b,"setPosition:ofDividerAtIndex:",(_4f[_originComponent]+_initialOffset),_currentDivider);
}
}
objj_msgSend(CPApp,"setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:",_4b,sel_getUid("trackDivider:"),CPLeftMouseDraggedMask|CPLeftMouseUpMask,nil,nil,YES);
}
}),new objj_method(sel_getUid("mouseDown:"),function(_55,_56,_57){
with(_55){
objj_msgSend(_55,"trackDivider:",_57);
}
}),new objj_method(sel_getUid("maxPossiblePositionOfDividerAtIndex:"),function(_58,_59,_5a){
with(_58){
var _5b=objj_msgSend(_subviews[_5a+1],"frame");
if(_5a+1<objj_msgSend(_subviews,"count")-1){
return _5b.origin[_originComponent]+_5b.size[_sizeComponent]-objj_msgSend(_58,"dividerThickness");
}else{
return objj_msgSend(_58,"frame").size[_sizeComponent]-objj_msgSend(_58,"dividerThickness");
}
}
}),new objj_method(sel_getUid("minPossiblePositionOfDividerAtIndex:"),function(_5c,_5d,_5e){
with(_5c){
if(_5e>0){
var _5f=objj_msgSend(_subviews[_5e-1],"frame");
return _5f.origin[_originComponent]+_5f.size[_sizeComponent]+objj_msgSend(_5c,"dividerThickness");
}else{
return 0;
}
}
}),new objj_method(sel_getUid("setPosition:ofDividerAtIndex:"),function(_60,_61,_62,_63){
with(_60){
objj_msgSend(_60,"_adjustSubviewsWithCalculatedSize");
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("splitView:constrainSplitPosition:ofSubviewAt:"))){
_62=objj_msgSend(_delegate,"splitView:constrainSplitPosition:ofSubviewAt:",_60,_62,_63);
}
var _64=objj_msgSend(_60,"maxPossiblePositionOfDividerAtIndex:",_63),_65=objj_msgSend(_60,"minPossiblePositionOfDividerAtIndex:",_63),_66=_64,_67=_65;
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("splitView:constrainMinCoordinate:ofSubviewAt:"))){
_67=objj_msgSend(_delegate,"splitView:constrainMinCoordinate:ofSubviewAt:",_60,_65,_63);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("splitView:constrainMaxCoordinate:ofSubviewAt:"))){
_66=objj_msgSend(_delegate,"splitView:constrainMaxCoordinate:ofSubviewAt:",_60,_64,_63);
}
var _68=objj_msgSend(_60,"frame"),_69=_subviews[_63],_6a=objj_msgSend(_69,"frame"),_6b=_subviews[_63+1],_6c=objj_msgSend(_6b,"frame");
var _6d=MAX(MIN(_62,_66),_67);
if(_62<_65+(_67-_65)/2){
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("splitView:canCollapseSubview:"))){
if(objj_msgSend(_delegate,"splitView:canCollapseSubview:",_60,_69)){
_6d=_65;
}
}
}
_6a.size[_sizeComponent]=_6d-_6a.origin[_originComponent];
objj_msgSend(_subviews[_63],"setFrame:",_6a);
_6c.size[_sizeComponent]=_6c.origin[_originComponent]+_6c.size[_sizeComponent]-_6d-objj_msgSend(_60,"dividerThickness");
_6c.origin[_originComponent]=_6d+objj_msgSend(_60,"dividerThickness");
objj_msgSend(_subviews[_63+1],"setFrame:",_6c);
objj_msgSend(_60,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("setFrameSize:"),function(_6e,_6f,_70){
with(_6e){
objj_msgSend(_6e,"_adjustSubviewsWithCalculatedSize");
objj_msgSendSuper({receiver:_6e,super_class:objj_getClass("CPSplitView").super_class},"setFrameSize:",_70);
objj_msgSend(_6e,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("resizeSubviewsWithOldSize:"),function(_71,_72,_73){
with(_71){
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("splitView:resizeSubviewsWithOldSize:"))){
objj_msgSend(_delegate,"splitView:resizeSubviewsWithOldSize:",_71,_73);
return;
}
objj_msgSend(_71,"_postNotificationWillResize");
var _74=0,_75=objj_msgSend(_subviews,"count"),_76=objj_msgSend(_71,"bounds"),_77=objj_msgSend(_71,"dividerThickness"),_78=_75-1,_79=0,_7a=0,_7b=-1,_7c=0,_7d=objj_msgSend(_71,"isVertical");
for(_74=0;_74<_75;++_74){
var _7e=_subviews[_74],_7f=_7d?objj_msgSend(_7e,"autoresizingMask")&CPViewWidthSizable:objj_msgSend(_7e,"autoresizingMask")&CPViewHeightSizable;
if(_7f){
_79+=objj_msgSend(_7e,"frame").size[_sizeComponent];
_7b=_74;
_7c++;
}
}
if(_7c===_75){
_79=0;
}
var _7a=_79?_76.size[_sizeComponent]-_79:0,_80=_76.size[_sizeComponent]-_73[_sizeComponent],_81=(_73[_sizeComponent]-_78*_77-_7a),_82=_81<=0?0:(_76.size[_sizeComponent]-_78*_77-_7a)/_81;
for(_74=0;_74<_75;++_74){
var _7e=_subviews[_74],_83=CGRectMakeCopy(_76),_7f=_7d?objj_msgSend(_7e,"autoresizingMask")&CPViewWidthSizable:objj_msgSend(_7e,"autoresizingMask")&CPViewHeightSizable;
if(_74+1==_75){
_83.size[_sizeComponent]=_76.size[_sizeComponent]-_83.origin[_originComponent];
}else{
if(_79&&_7f&&_7b===_74){
_83.size[_sizeComponent]=MAX(0,ROUND(objj_msgSend(_7e,"frame").size[_sizeComponent]+_80));
}else{
if(_7f||!_79){
_83.size[_sizeComponent]=MAX(0,ROUND(_82*objj_msgSend(_7e,"frame").size[_sizeComponent]));
_80-=(_83.size[_sizeComponent]-objj_msgSend(_7e,"frame").size[_sizeComponent]);
}else{
if(_79&&!_7f){
_83.size[_sizeComponent]=objj_msgSend(_7e,"frame").size[_sizeComponent];
}
}
}
}
_76.origin[_originComponent]+=_83.size[_sizeComponent]+_77;
objj_msgSend(_7e,"setFrame:",_83);
}
objj_msgSend(_71,"_postNotificationDidResize");
}
}),new objj_method(sel_getUid("setDelegate:"),function(_84,_85,_86){
with(_84){
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("splitViewDidResizeSubviews:"))){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"removeObserver:name:object:",_delegate,CPSplitViewDidResizeSubviewsNotification,_84);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("splitViewWillResizeSubviews:"))){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"removeObserver:name:object:",_delegate,CPSplitViewWillResizeSubviewsNotification,_84);
}
_delegate=_86;
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("splitViewDidResizeSubviews:"))){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"addObserver:selector:name:object:",_delegate,sel_getUid("splitViewDidResizeSubviews:"),CPSplitViewDidResizeSubviewsNotification,_84);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("splitViewWillResizeSubviews:"))){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"addObserver:selector:name:object:",_delegate,sel_getUid("splitViewWillResizeSubviews:"),CPSplitViewWillResizeSubviewsNotification,_84);
}
}
}),new objj_method(sel_getUid("_postNotificationWillResize"),function(_87,_88){
with(_87){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPSplitViewWillResizeSubviewsNotification,_87);
}
}),new objj_method(sel_getUid("_postNotificationDidResize"),function(_89,_8a){
with(_89){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPSplitViewDidResizeSubviewsNotification,_89);
}
})]);
class_addMethods(_4,[new objj_method(sel_getUid("initialize"),function(_8b,_8c){
with(_8b){
if(_8b!=objj_msgSend(CPSplitView,"class")){
return;
}
var _8d=objj_msgSend(CPBundle,"bundleForClass:",_8b);
_1=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_8d,"pathForResource:","CPSplitView/CPSplitViewHorizontal.png"),CPSizeMake(5,10));
_2=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_8d,"pathForResource:","CPSplitView/CPSplitViewVertical.png"),CPSizeMake(10,5));
}
})]);
var _8e="CPSplitViewDelegateKey",_8f="CPSplitViewIsVerticalKey",_90="CPSplitViewIsPaneSplitterKey";
var _3=objj_getClass("CPSplitView");
if(!_3){
throw new SyntaxError("*** Could not find definition for class \"CPSplitView\"");
}
var _4=_3.isa;
class_addMethods(_3,[new objj_method(sel_getUid("initWithCoder:"),function(_91,_92,_93){
with(_91){
_91=objj_msgSendSuper({receiver:_91,super_class:objj_getClass("CPSplitView").super_class},"initWithCoder:",_93);
if(_91){
_currentDivider=CPNotFound;
_DOMDividerElements=[];
_delegate=objj_msgSend(_93,"decodeObjectForKey:",_8e);
_isPaneSplitter=objj_msgSend(_93,"decodeBoolForKey:",_90);
objj_msgSend(_91,"_setVertical:",objj_msgSend(_93,"decodeBoolForKey:",_8f));
}
return _91;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_94,_95,_96){
with(_94){
objj_msgSendSuper({receiver:_94,super_class:objj_getClass("CPSplitView").super_class},"encodeWithCoder:",_96);
objj_msgSend(_96,"encodeConditionalObject:forKey:",_delegate,_8e);
objj_msgSend(_96,"encodeBool:forKey:",_isVertical,_8f);
objj_msgSend(_96,"encodeBool:forKey:",_isPaneSplitter,_90);
}
})]);
p;17;CPStringDrawing.jt;712;@STATIC;1.0;I;21;Foundation/CPString.ji;18;CPPlatformString.jt;645;
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("CPPlatformString.j",YES);
var _1=objj_getClass("CPString");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPString\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("cssString"),function(_3,_4){
with(_3){
return _3;
}
}),new objj_method(sel_getUid("sizeWithFont:"),function(_5,_6,_7){
with(_5){
return objj_msgSend(_5,"sizeWithFont:inWidth:",_7,NULL);
}
}),new objj_method(sel_getUid("sizeWithFont:inWidth:"),function(_8,_9,_a,_b){
with(_8){
return objj_msgSend(CPPlatformString,"sizeOfString:withFont:forWidth:",_8,_a,_b);
}
})]);
p;15;CPTableColumn.jt;10806;@STATIC;1.0;I;25;Foundation/CPDictionary.jI;21;Foundation/CPObject.jI;29;Foundation/CPSortDescriptor.jI;21;Foundation/CPString.ji;19;CPTableHeaderView.jt;10646;
objj_executeFile("Foundation/CPDictionary.j",NO);
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("Foundation/CPSortDescriptor.j",NO);
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("CPTableHeaderView.j",YES);
CPTableColumnNoResizing=0;
CPTableColumnAutoresizingMask=1<<0;
CPTableColumnUserResizingMask=1<<1;
var _1=objj_allocateClassPair(CPObject,"CPTableColumn"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_tableView"),new objj_ivar("_headerView"),new objj_ivar("_dataView"),new objj_ivar("_dataViewData"),new objj_ivar("_width"),new objj_ivar("_minWidth"),new objj_ivar("_maxWidth"),new objj_ivar("_resizingMask"),new objj_ivar("_identifier"),new objj_ivar("_isEditable"),new objj_ivar("_sortDescriptorPrototype"),new objj_ivar("_isHidden"),new objj_ivar("_headerToolTip"),new objj_ivar("_disableResizingPosting")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("disableResizingPosting"),function(_3,_4){
with(_3){
return _disableResizingPosting;
}
}),new objj_method(sel_getUid("setDisableResizingPosting:"),function(_5,_6,_7){
with(_5){
_disableResizingPosting=_7;
}
}),new objj_method(sel_getUid("init"),function(_8,_9){
with(_8){
return objj_msgSend(_8,"initWithIdentifier:","");
}
}),new objj_method(sel_getUid("initWithIdentifier:"),function(_a,_b,_c){
with(_a){
_a=objj_msgSendSuper({receiver:_a,super_class:objj_getClass("CPTableColumn").super_class},"init");
if(_a){
_dataViewData={};
_width=100;
_minWidth=10;
_maxWidth=1000000;
_resizingMask=CPTableColumnAutoresizingMask|CPTableColumnUserResizingMask;
_disableResizingPosting=NO;
objj_msgSend(_a,"setIdentifier:",_c);
var _d=objj_msgSend(objj_msgSend(_CPTableColumnHeaderView,"alloc"),"initWithFrame:",CGRectMakeZero());
objj_msgSend(_a,"setHeaderView:",_d);
var _e=objj_msgSend(CPTextField,"new");
objj_msgSend(_e,"setLineBreakMode:",CPLineBreakByTruncatingTail);
objj_msgSend(_e,"setValue:forThemeAttribute:",objj_msgSend(CPColor,"colorWithHexString:","333333"),"text-color");
objj_msgSend(_e,"setValue:forThemeAttribute:inState:",objj_msgSend(CPColor,"whiteColor"),"text-color",CPThemeStateSelected);
objj_msgSend(_e,"setValue:forThemeAttribute:inState:",objj_msgSend(CPFont,"boldSystemFontOfSize:",12),"font",CPThemeStateSelected);
objj_msgSend(_e,"setValue:forThemeAttribute:",CPCenterVerticalTextAlignment,"vertical-alignment");
objj_msgSend(_a,"setDataView:",_e);
}
return _a;
}
}),new objj_method(sel_getUid("setTableView:"),function(_f,_10,_11){
with(_f){
_tableView=_11;
}
}),new objj_method(sel_getUid("tableView"),function(_12,_13){
with(_12){
return _tableView;
}
}),new objj_method(sel_getUid("setWidth:"),function(_14,_15,_16){
with(_14){
_16=+_16;
if(_width===_16){
return;
}
var _17=MIN(MAX(_16,objj_msgSend(_14,"minWidth")),objj_msgSend(_14,"maxWidth"));
if(_width===_17){
return;
}
var _18=_width;
_width=_17;
var _19=objj_msgSend(_14,"tableView");
if(_19){
var _1a=objj_msgSend(objj_msgSend(_19,"tableColumns"),"indexOfObjectIdenticalTo:",_14),_1b=_19._dirtyTableColumnRangeIndex;
if(_1b<0){
_19._dirtyTableColumnRangeIndex=_1a;
}else{
_19._dirtyTableColumnRangeIndex=MIN(_1a,_19._dirtyTableColumnRangeIndex);
}
var _1c=_19._exposedRows,_1d=objj_msgSend(CPIndexSet,"indexSetWithIndexesInRange:",CPMakeRange(_1a,objj_msgSend(_19._exposedColumns,"lastIndex")-_1a+1));
objj_msgSend(_19,"_layoutDataViewsInRows:columns:",_1c,_1d);
objj_msgSend(_19,"tile");
if(!_disableResizingPosting){
objj_msgSend(_14,"_postDidResizeNotificationWithOldWidth:",_18);
}
}
}
}),new objj_method(sel_getUid("width"),function(_1e,_1f){
with(_1e){
return _width;
}
}),new objj_method(sel_getUid("setMinWidth:"),function(_20,_21,_22){
with(_20){
_22=+_22;
if(_minWidth===_22){
return;
}
_minWidth=_22;
var _23=objj_msgSend(_20,"width"),_24=MAX(_23,objj_msgSend(_20,"minWidth"));
if(_23!==_24){
objj_msgSend(_20,"setWidth:",_24);
}
}
}),new objj_method(sel_getUid("minWidth"),function(_25,_26){
with(_25){
return _minWidth;
}
}),new objj_method(sel_getUid("setMaxWidth:"),function(_27,_28,_29){
with(_27){
_29=+_29;
if(_maxWidth===_29){
return;
}
_maxWidth=_29;
var _2a=objj_msgSend(_27,"width"),_2b=MIN(_2a,objj_msgSend(_27,"maxWidth"));
if(_2a!==_2b){
objj_msgSend(_27,"setWidth:",_2b);
}
}
}),new objj_method(sel_getUid("maxWidth"),function(_2c,_2d){
with(_2c){
return _maxWidth;
}
}),new objj_method(sel_getUid("setResizingMask:"),function(_2e,_2f,_30){
with(_2e){
_resizingMask=_30;
}
}),new objj_method(sel_getUid("resizingMask"),function(_31,_32){
with(_31){
return _resizingMask;
}
}),new objj_method(sel_getUid("sizeToFit"),function(_33,_34){
with(_33){
var _35=(objj_msgSend(_headerView,"frame").size.width);
if(_35<objj_msgSend(_33,"minWidth")){
objj_msgSend(_33,"setMinWidth:",_35);
}else{
if(_35>objj_msgSend(_33,"maxWidth")){
objj_msgSend(_33,"setMaxWidth:",_35);
}
}
if(_width!==_35){
objj_msgSend(_33,"setWidth:",_35);
}
}
}),new objj_method(sel_getUid("setHeaderView:"),function(_36,_37,_38){
with(_36){
if(!_38){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Attempt to set nil header view on "+objj_msgSend(_36,"description"));
}
_headerView=_38;
var _39=objj_msgSend(_tableView,"headerView");
objj_msgSend(_39,"setNeedsLayout");
objj_msgSend(_39,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("headerView"),function(_3a,_3b){
with(_3a){
return _headerView;
}
}),new objj_method(sel_getUid("setDataView:"),function(_3c,_3d,_3e){
with(_3c){
if(_dataView===_3e){
return;
}
if(_dataView){
_dataViewData[objj_msgSend(_dataView,"UID")]=nil;
}
_dataView=_3e;
_dataViewData[objj_msgSend(_3e,"UID")]=objj_msgSend(CPKeyedArchiver,"archivedDataWithRootObject:",_3e);
}
}),new objj_method(sel_getUid("dataView"),function(_3f,_40){
with(_3f){
return _dataView;
}
}),new objj_method(sel_getUid("dataViewForRow:"),function(_41,_42,_43){
with(_41){
return objj_msgSend(_41,"dataView");
}
}),new objj_method(sel_getUid("_newDataViewForRow:"),function(_44,_45,_46){
with(_44){
var _47=objj_msgSend(_44,"dataViewForRow:",_46),_48=objj_msgSend(_47,"UID");
var x=objj_msgSend(_44,"tableView")._cachedDataViews[_48];
if(x&&x.length){
return x.pop();
}
if(!_dataViewData[_48]){
_dataViewData[_48]=objj_msgSend(CPKeyedArchiver,"archivedDataWithRootObject:",_47);
}
var _49=objj_msgSend(CPKeyedUnarchiver,"unarchiveObjectWithData:",_dataViewData[_48]);
_49.identifier=_48;
return _49;
}
}),new objj_method(sel_getUid("setIdentifier:"),function(_4a,_4b,_4c){
with(_4a){
_identifier=_4c;
}
}),new objj_method(sel_getUid("identifier"),function(_4d,_4e){
with(_4d){
return _identifier;
}
}),new objj_method(sel_getUid("setEditable:"),function(_4f,_50,_51){
with(_4f){
_isEditable=_51;
}
}),new objj_method(sel_getUid("isEditable"),function(_52,_53){
with(_52){
return _isEditable;
}
}),new objj_method(sel_getUid("setSortDescriptorPrototype:"),function(_54,_55,_56){
with(_54){
_sortDescriptorPrototype=_56;
}
}),new objj_method(sel_getUid("sortDescriptorPrototype"),function(_57,_58){
with(_57){
return _sortDescriptorPrototype;
}
}),new objj_method(sel_getUid("setHidden:"),function(_59,_5a,_5b){
with(_59){
_isHidden=_5b;
}
}),new objj_method(sel_getUid("isHidden"),function(_5c,_5d){
with(_5c){
return _isHidden;
}
}),new objj_method(sel_getUid("setHeaderToolTip:"),function(_5e,_5f,_60){
with(_5e){
_headerToolTip=_60;
}
}),new objj_method(sel_getUid("headerToolTip"),function(_61,_62){
with(_61){
return _headerToolTip;
}
}),new objj_method(sel_getUid("_postDidResizeNotificationWithOldWidth:"),function(_63,_64,_65){
with(_63){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:userInfo:",CPTableViewColumnDidResizeNotification,objj_msgSend(_63,"tableView"),objj_msgSend(CPDictionary,"dictionaryWithObjects:forKeys:",[_63,_65],["CPTableColumn","CPOldWidth"]));
}
})]);
var _66="CPTableColumnIdentifierKey",_67="CPTableColumnHeaderViewKey",_68="CPTableColumnDataViewKey",_69="CPTableColumnWidthKey",_6a="CPTableColumnMinWidthKey",_6b="CPTableColumnMaxWidthKey",_6c="CPTableColumnResizingMaskKey";
var _1=objj_getClass("CPTableColumn");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPTableColumn\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_6d,_6e,_6f){
with(_6d){
_6d=objj_msgSendSuper({receiver:_6d,super_class:objj_getClass("CPTableColumn").super_class},"init");
if(_6d){
_dataViewData={};
_width=objj_msgSend(_6f,"decodeFloatForKey:",_69);
_minWidth=objj_msgSend(_6f,"decodeFloatForKey:",_6a);
_maxWidth=objj_msgSend(_6f,"decodeFloatForKey:",_6b);
objj_msgSend(_6d,"setIdentifier:",objj_msgSend(_6f,"decodeObjectForKey:",_66));
objj_msgSend(_6d,"setHeaderView:",objj_msgSend(_6f,"decodeObjectForKey:",_67));
objj_msgSend(_6d,"setDataView:",objj_msgSend(_6f,"decodeObjectForKey:",_68));
objj_msgSend(_6d,"setHeaderView:",objj_msgSend(_6f,"decodeObjectForKey:",_67));
_resizingMask=objj_msgSend(_6f,"decodeBoolForKey:",_6c);
}
return _6d;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_70,_71,_72){
with(_70){
objj_msgSend(_72,"encodeObject:forKey:",_identifier,_66);
objj_msgSend(_72,"encodeObject:forKey:",_width,_69);
objj_msgSend(_72,"encodeObject:forKey:",_minWidth,_6a);
objj_msgSend(_72,"encodeObject:forKey:",_maxWidth,_6b);
objj_msgSend(_72,"encodeObject:forKey:",_headerView,_67);
objj_msgSend(_72,"encodeObject:forKey:",_dataView,_68);
objj_msgSend(_72,"encodeObject:forKey:",_resizingMask,_6c);
}
})]);
var _1=objj_getClass("CPTableColumn");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPTableColumn\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("setHeaderCell:"),function(_73,_74,_75){
with(_73){
objj_msgSend(CPException,"raise:reason:",CPUnsupportedMethodException,"setHeaderCell: is not supported. -setHeaderCell:aView instead.");
}
}),new objj_method(sel_getUid("headerCell"),function(_76,_77){
with(_76){
objj_msgSend(CPException,"raise:reason:",CPUnsupportedMethodException,"headCell is not supported. -headerView instead.");
}
}),new objj_method(sel_getUid("setDataCell:"),function(_78,_79,_7a){
with(_78){
objj_msgSend(CPException,"raise:reason:",CPUnsupportedMethodException,"setDataCell: is not supported. Use -setHeaderCell:aView instead.");
}
}),new objj_method(sel_getUid("dataCell"),function(_7b,_7c){
with(_7b){
objj_msgSend(CPException,"raise:reason:",CPUnsupportedMethodException,"dataCell is not supported. Use -dataCell instead.");
}
}),new objj_method(sel_getUid("dataCellForRow:"),function(_7d,_7e,row){
with(_7d){
objj_msgSend(CPException,"raise:reason:",CPUnsupportedMethodException,"dataCellForRow: is not supported. Use -dataViewForRow:row instead.");
}
})]);
p;19;CPTableHeaderView.jt;14359;@STATIC;1.0;i;15;CPTableColumn.ji;13;CPTableView.ji;8;CPView.jt;14289;
objj_executeFile("CPTableColumn.j",YES);
objj_executeFile("CPTableView.j",YES);
objj_executeFile("CPView.j",YES);
var _1=objj_allocateClassPair(CPView,"_CPTableColumnHeaderView"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_textField")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithFrame:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("_CPTableColumnHeaderView").super_class},"initWithFrame:",_5);
if(_3){
objj_msgSend(_3,"_init");
}
return _3;
}
}),new objj_method(sel_getUid("_init"),function(_6,_7){
with(_6){
_textField=objj_msgSend(objj_msgSend(_CPImageAndTextView,"alloc"),"initWithFrame:",CGRectMake(5,1,CGRectGetWidth(objj_msgSend(_6,"bounds"))-10,CGRectGetHeight(objj_msgSend(_6,"bounds"))-1));
objj_msgSend(_textField,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
objj_msgSend(_textField,"setLineBreakMode:",CPLineBreakByTruncatingTail);
objj_msgSend(_textField,"setTextColor:",objj_msgSend(CPColor,"colorWithHexString:","333333"));
objj_msgSend(_textField,"setFont:",objj_msgSend(CPFont,"boldSystemFontOfSize:",12));
objj_msgSend(_textField,"setAlignment:",CPLeftTextAlignment);
objj_msgSend(_textField,"setVerticalAlignment:",CPCenterVerticalTextAlignment);
objj_msgSend(_textField,"setTextShadowColor:",objj_msgSend(CPColor,"whiteColor"));
objj_msgSend(_textField,"setTextShadowOffset:",CGSizeMake(0,1));
objj_msgSend(_6,"addSubview:",_textField);
}
}),new objj_method(sel_getUid("layoutSubviews"),function(_8,_9){
with(_8){
var _a=objj_msgSend(_8,"themeState");
if(_a&CPThemeStateSelected&&_a&CPThemeStateHighlighted){
objj_msgSend(_8,"setBackgroundColor:",objj_msgSend(CPColor,"colorWithPatternImage:",CPAppKitImage("tableview-headerview-highlighted-pressed.png",CGSizeMake(1,22))));
}else{
if(_a&CPThemeStateSelected){
objj_msgSend(_8,"setBackgroundColor:",objj_msgSend(CPColor,"colorWithPatternImage:",CPAppKitImage("tableview-headerview-highlighted.png",CGSizeMake(1,22))));
}else{
if(_a&CPThemeStateHighlighted){
objj_msgSend(_8,"setBackgroundColor:",objj_msgSend(CPColor,"colorWithPatternImage:",CPAppKitImage("tableview-headerview-pressed.png",CGSizeMake(1,22))));
}else{
objj_msgSend(_8,"setBackgroundColor:",objj_msgSend(CPColor,"colorWithPatternImage:",CPAppKitImage("tableview-headerview.png",CGSizeMake(1,22))));
}
}
}
}
}),new objj_method(sel_getUid("setStringValue:"),function(_b,_c,_d){
with(_b){
objj_msgSend(_textField,"setText:",_d);
}
}),new objj_method(sel_getUid("stringValue"),function(_e,_f){
with(_e){
return objj_msgSend(_textField,"text");
}
}),new objj_method(sel_getUid("textField"),function(_10,_11){
with(_10){
return _textField;
}
}),new objj_method(sel_getUid("sizeToFit"),function(_12,_13){
with(_12){
objj_msgSend(_textField,"sizeToFit");
}
}),new objj_method(sel_getUid("setFont:"),function(_14,_15,_16){
with(_14){
objj_msgSend(_textField,"setFont:",_16);
}
}),new objj_method(sel_getUid("setValue:forThemeAttribute:"),function(_17,_18,_19,_1a){
with(_17){
objj_msgSend(_textField,"setValue:forThemeAttribute:",_19,_1a);
}
}),new objj_method(sel_getUid("_setIndicatorImage:"),function(_1b,_1c,_1d){
with(_1b){
if(_1d){
objj_msgSend(_textField,"setImage:",_1d);
objj_msgSend(_textField,"setImagePosition:",CPImageRight);
}else{
objj_msgSend(_textField,"setImagePosition:",CPNoImage);
}
}
})]);
var _1e="_CPTableColumnHeaderViewStringValueKey",_1f="_CPTableColumnHeaderViewFontKey",_20="_CPTableColumnHeaderViewImageKey";
var _1=objj_getClass("_CPTableColumnHeaderView");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"_CPTableColumnHeaderView\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_21,_22,_23){
with(_21){
if(_21=objj_msgSendSuper({receiver:_21,super_class:objj_getClass("_CPTableColumnHeaderView").super_class},"initWithCoder:",_23)){
objj_msgSend(_21,"_init");
objj_msgSend(_21,"_setIndicatorImage:",objj_msgSend(_23,"decodeObjectForKey:",_20));
objj_msgSend(_21,"setStringValue:",objj_msgSend(_23,"decodeObjectForKey:",_1e));
objj_msgSend(_21,"setFont:",objj_msgSend(_23,"decodeObjectForKey:",_1f));
}
return _21;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_24,_25,_26){
with(_24){
objj_msgSendSuper({receiver:_24,super_class:objj_getClass("_CPTableColumnHeaderView").super_class},"encodeWithCoder:",_26);
objj_msgSend(_26,"encodeObject:forKey:",objj_msgSend(_textField,"text"),_1e);
objj_msgSend(_26,"encodeObject:forKey:",objj_msgSend(_textField,"image"),_20);
objj_msgSend(_26,"encodeObject:forKey:",objj_msgSend(_textField,"font"),_1f);
}
})]);
var _1=objj_allocateClassPair(CPView,"CPTableHeaderView"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_resizedColumn"),new objj_ivar("_draggedColumn"),new objj_ivar("_pressedColumn"),new objj_ivar("_draggedDistance"),new objj_ivar("_lastLocation"),new objj_ivar("_columnOldWidth"),new objj_ivar("_tableView")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("resizedColumn"),function(_27,_28){
with(_27){
return _resizedColumn;
}
}),new objj_method(sel_getUid("draggedColumn"),function(_29,_2a){
with(_29){
return _draggedColumn;
}
}),new objj_method(sel_getUid("pressedColumn"),function(_2b,_2c){
with(_2b){
return _pressedColumn;
}
}),new objj_method(sel_getUid("draggedDistance"),function(_2d,_2e){
with(_2d){
return _draggedDistance;
}
}),new objj_method(sel_getUid("tableView"),function(_2f,_30){
with(_2f){
return _tableView;
}
}),new objj_method(sel_getUid("setTableView:"),function(_31,_32,_33){
with(_31){
_tableView=_33;
}
}),new objj_method(sel_getUid("_init"),function(_34,_35){
with(_34){
_resizedColumn=-1;
_draggedColumn=-1;
_pressedColumn=-1;
_draggedDistance=0;
_lastLocation=nil;
_columnOldWidth=nil;
objj_msgSend(_34,"setBackgroundColor:",objj_msgSend(CPColor,"colorWithPatternImage:",CPAppKitImage("tableview-headerview.png",CGSizeMake(1,22))));
}
}),new objj_method(sel_getUid("initWithFrame:"),function(_36,_37,_38){
with(_36){
_36=objj_msgSendSuper({receiver:_36,super_class:objj_getClass("CPTableHeaderView").super_class},"initWithFrame:",_38);
if(_36){
objj_msgSend(_36,"_init");
}
return _36;
}
}),new objj_method(sel_getUid("columnAtPoint:"),function(_39,_3a,_3b){
with(_39){
return objj_msgSend(_tableView,"columnAtPoint:",CGPointMake(_3b.x,0));
}
}),new objj_method(sel_getUid("headerRectOfColumn:"),function(_3c,_3d,_3e){
with(_3c){
var _3f=objj_msgSend(_tableView,"tableColumns");
if(_3e<0||_3e>objj_msgSend(_3f,"count")){
objj_msgSend(CPException,"raise:reason:","invalid","tried to get headerRectOfColumn: on invalid column");
}
var _40=_tableView._tableColumnRanges[_3e],_41=objj_msgSend(_3c,"bounds");
var _42=ROUND(_40.location);
_41.origin.x=_42;
_41.size.width=FLOOR(_40.length+_40.location-_42);
return _41;
}
}),new objj_method(sel_getUid("_cursorRectForColumn:"),function(_43,_44,_45){
with(_43){
if(_45==-1||!(objj_msgSend(_tableView._tableColumns[_45],"resizingMask")&CPTableColumnUserResizingMask)){
return CGRectMakeZero();
}
var _46=objj_msgSend(_43,"headerRectOfColumn:",_45);
_46.origin.x=CGRectGetMaxX(_46)-5;
_46.size.width=20;
return _46;
}
}),new objj_method(sel_getUid("_setPressedColumn:"),function(_47,_48,_49){
with(_47){
if(_pressedColumn!=-1){
var _4a=objj_msgSend(_tableView._tableColumns[_pressedColumn],"headerView");
objj_msgSend(_4a,"unsetThemeState:",CPThemeStateHighlighted);
}
if(_49!=-1){
var _4a=objj_msgSend(_tableView._tableColumns[_49],"headerView");
objj_msgSend(_4a,"setThemeState:",CPThemeStateHighlighted);
}
_pressedColumn=_49;
}
}),new objj_method(sel_getUid("mouseDown:"),function(_4b,_4c,_4d){
with(_4b){
var _4e=objj_msgSend(_4b,"convertPoint:fromView:",objj_msgSend(_4d,"locationInWindow"),nil),_4f=objj_msgSend(_4b,"columnAtPoint:",_4e);
objj_msgSend(_tableView,"_sendDelegateDidMouseDownInHeader:",_4f);
var _50=CGPointMake(_4e.x-5,_4e.y),_51=objj_msgSend(_4b,"columnAtPoint:",_50);
if(_51==-1){
return;
}
if(objj_msgSend(_tableView,"allowsColumnResizing")&&CGRectContainsPoint(objj_msgSend(_4b,"_cursorRectForColumn:",_51),_4e)){
_resizedColumn=_51;
objj_msgSend(_tableView._tableColumns[_resizedColumn],"setDisableResizingPosting:",YES);
objj_msgSend(_tableView,"setDisableAutomaticResizing:",YES);
objj_msgSend(_4b,"trackResizeWithEvent:",_4d);
}else{
objj_msgSend(_4b,"_setPressedColumn:",_4f);
objj_msgSend(_4b,"trackMouseWithEvent:",_4d);
}
}
}),new objj_method(sel_getUid("trackMouseWithEvent:"),function(_52,_53,_54){
with(_52){
var _55=objj_msgSend(_54,"type");
if(_55==CPLeftMouseUp){
var _56=objj_msgSend(_52,"convertPoint:fromView:",objj_msgSend(_54,"locationInWindow"),nil),_57=objj_msgSend(_52,"columnAtPoint:",_56);
objj_msgSend(_52,"_setPressedColumn:",-1);
if(_57!=-1){
objj_msgSend(_tableView,"_didClickTableColumn:modifierFlags:",_57,objj_msgSend(_54,"modifierFlags"));
}
return;
}
objj_msgSend(CPApp,"setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:",_52,sel_getUid("trackMouseWithEvent:"),CPLeftMouseDraggedMask|CPLeftMouseUpMask|CPLeftMouseDownMask,nil,nil,YES);
}
}),new objj_method(sel_getUid("trackResizeWithEvent:"),function(_58,_59,_5a){
with(_58){
var _5b=objj_msgSend(_58,"convertPoint:fromView:",objj_msgSend(_5a,"locationInWindow"),nil),_5c=objj_msgSend(objj_msgSend(_tableView,"tableColumns"),"objectAtIndex:",_resizedColumn),_5d=objj_msgSend(_5a,"type");
if(_lastLocation==nil){
_lastLocation=_5b;
}
if(_columnOldWidth==nil){
_columnOldWidth=objj_msgSend(_5c,"width");
}
if(_5d===CPLeftMouseUp){
objj_msgSend(_58,"_updateResizeCursor:",_5a);
objj_msgSend(_5c,"_postDidResizeNotificationWithOldWidth:",_columnOldWidth);
objj_msgSend(_5c,"setDisableResizingPosting:",NO);
objj_msgSend(_tableView,"setDisableAutomaticResizing:",NO);
_resizedColumn=-1;
_lastLocation=nil;
_columnOldWidth=nil;
return;
}else{
if(_5d===CPLeftMouseDragged){
var _5e=objj_msgSend(_5c,"width")+_5b.x-_lastLocation.x;
if(_5e<objj_msgSend(_5c,"minWidth")){
objj_msgSend(objj_msgSend(CPCursor,"resizeRightCursor"),"set");
}else{
if(_5e>objj_msgSend(_5c,"maxWidth")){
objj_msgSend(objj_msgSend(CPCursor,"resizeLeftCursor"),"set");
}else{
_tableView._lastColumnShouldSnap=NO;
objj_msgSend(_5c,"setWidth:",_5e);
_lastLocation=_5b;
objj_msgSend(objj_msgSend(CPCursor,"resizeLeftRightCursor"),"set");
objj_msgSend(_58,"setNeedsLayout");
objj_msgSend(_58,"setNeedsDisplay:",YES);
}
}
}
}
objj_msgSend(CPApp,"setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:",_58,sel_getUid("trackResizeWithEvent:"),CPLeftMouseDraggedMask|CPLeftMouseUpMask,nil,nil,YES);
}
}),new objj_method(sel_getUid("_updateResizeCursor:"),function(_5f,_60,_61){
with(_5f){
if(!objj_msgSend(_tableView,"allowsColumnResizing")||(objj_msgSend(_61,"type")===CPLeftMouseUp&&!objj_msgSend(objj_msgSend(_5f,"window"),"acceptsMouseMovedEvents"))){
objj_msgSend(objj_msgSend(CPCursor,"arrowCursor"),"set");
return;
}
var _62=objj_msgSend(_5f,"convertPoint:fromView:",objj_msgSend(_61,"locationInWindow"),nil),_63=CGPointMake(_62.x-5,_62.y),_64=objj_msgSend(_5f,"columnAtPoint:",_63);
if(_64>=0&&CGRectContainsPoint(objj_msgSend(_5f,"_cursorRectForColumn:",_64),_62)){
var _65=objj_msgSend(objj_msgSend(_tableView,"tableColumns"),"objectAtIndex:",_64),_66=objj_msgSend(_65,"width");
if(_66==objj_msgSend(_65,"minWidth")){
objj_msgSend(objj_msgSend(CPCursor,"resizeRightCursor"),"set");
}else{
if(_66==objj_msgSend(_65,"maxWidth")){
objj_msgSend(objj_msgSend(CPCursor,"resizeLeftCursor"),"set");
}else{
objj_msgSend(objj_msgSend(CPCursor,"resizeLeftRightCursor"),"set");
}
}
}else{
objj_msgSend(objj_msgSend(CPCursor,"arrowCursor"),"set");
}
}
}),new objj_method(sel_getUid("viewDidMoveToWindow"),function(_67,_68){
with(_67){
}
}),new objj_method(sel_getUid("mouseEntered:"),function(_69,_6a,_6b){
with(_69){
objj_msgSend(_69,"_updateResizeCursor:",_6b);
}
}),new objj_method(sel_getUid("mouseMoved:"),function(_6c,_6d,_6e){
with(_6c){
objj_msgSend(_6c,"_updateResizeCursor:",_6e);
}
}),new objj_method(sel_getUid("mouseExited:"),function(_6f,_70,_71){
with(_6f){
objj_msgSend(objj_msgSend(CPCursor,"arrowCursor"),"set");
}
}),new objj_method(sel_getUid("layoutSubviews"),function(_72,_73){
with(_72){
var _74=objj_msgSend(_tableView,"tableColumns"),_75=objj_msgSend(_74,"count");
for(var i=0;i<_75;i++){
var _76=objj_msgSend(_74,"objectAtIndex:",i),_77=objj_msgSend(_76,"headerView");
var _78=objj_msgSend(_72,"headerRectOfColumn:",i);
_78.size.height-=0.5;
if(i>0){
_78.origin.x+=0.5;
_78.size.width-=1;
}
objj_msgSend(_77,"setFrame:",_78);
if(objj_msgSend(_77,"superview")!=_72){
objj_msgSend(_72,"addSubview:",_77);
}
}
}
}),new objj_method(sel_getUid("drawRect:"),function(_79,_7a,_7b){
with(_79){
if(!_tableView){
return;
}
var _7c=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort"),_7d=objj_msgSend(_tableView,"columnIndexesInRect:",_7b),_7e=[],_7f=objj_msgSend(_tableView,"tableColumns"),_80=_tableView._exposedColumns,_81=objj_msgSend(_80,"firstIndex"),_82=CPMakeRange(_81,objj_msgSend(_80,"lastIndex")-_81+1);
CGContextSetLineWidth(_7c,1);
CGContextSetStrokeColor(_7c,objj_msgSend(_tableView,"gridColor"));
objj_msgSend(_7d,"getIndexes:maxCount:inIndexRange:",_7e,-1,_82);
var _83=0,_84=_7e.length,_85;
CGContextBeginPath(_7c);
for(;_83<_84;_83++){
var _86=_7e[_83],_87=objj_msgSend(_79,"headerRectOfColumn:",_86);
_85=CGRectGetMaxX(_87);
CGContextMoveToPoint(_7c,ROUND(_85)+0.5,ROUND(CGRectGetMinY(_87)));
CGContextAddLineToPoint(_7c,ROUND(_85)+0.5,ROUND(CGRectGetMaxY(_87)));
}
CGContextClosePath(_7c);
CGContextStrokePath(_7c);
}
})]);
var _88="CPTableHeaderViewTableViewKey";
var _1=objj_getClass("CPTableHeaderView");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPTableHeaderView\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_89,_8a,_8b){
with(_89){
if(_89=objj_msgSendSuper({receiver:_89,super_class:objj_getClass("CPTableHeaderView").super_class},"initWithCoder:",_8b)){
objj_msgSend(_89,"_init");
_tableView=objj_msgSend(_8b,"decodeObjectForKey:",_88);
}
return _89;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_8c,_8d,_8e){
with(_8c){
objj_msgSendSuper({receiver:_8c,super_class:objj_getClass("CPTableHeaderView").super_class},"encodeWithCoder:",_8e);
objj_msgSend(_8e,"encodeObject:forKey:",_tableView,_88);
}
})]);
p;13;CPTableView.jt;85667;@STATIC;1.0;I;20;Foundation/CPArray.jI;19;AppKit/CGGradient.ji;11;CPControl.ji;15;CPTableColumn.ji;15;_CPCornerView.ji;12;CPScroller.jt;85525;
objj_executeFile("Foundation/CPArray.j",NO);
objj_executeFile("AppKit/CGGradient.j",NO);
objj_executeFile("CPControl.j",YES);
objj_executeFile("CPTableColumn.j",YES);
objj_executeFile("_CPCornerView.j",YES);
objj_executeFile("CPScroller.j",YES);
CPTableViewColumnDidMoveNotification="CPTableViewColumnDidMoveNotification";
CPTableViewColumnDidResizeNotification="CPTableViewColumnDidResizeNotification";
CPTableViewSelectionDidChangeNotification="CPTableViewSelectionDidChangeNotification";
CPTableViewSelectionIsChangingNotification="CPTableViewSelectionIsChangingNotification";
var _1=1<<2,_2=1<<3,_3=1<<4,_4=1<<5,_5=1<<6,_6=1<<7;
var _7=1<<0,_8=1<<1,_9=1<<2,_a=1<<3,_b=1<<4,_c=1<<5,_d=1<<6,_e=1<<7,_f=1<<8,_10=1<<9,_11=1<<10,_12=1<<11,_13=1<<12,_14=1<<13,_15=1<<14,_16=1<<15,_17=1<<16,_18=1<<17,_19=1<<18,_1a=1<<19;
CPTableViewDraggingDestinationFeedbackStyleNone=-1;
CPTableViewDraggingDestinationFeedbackStyleRegular=0;
CPTableViewDraggingDestinationFeedbackStyleSourceList=1;
CPTableViewDropOn=0;
CPTableViewDropAbove=1;
CPTableViewSelectionHighlightStyleNone=-1;
CPTableViewSelectionHighlightStyleRegular=0;
CPTableViewSelectionHighlightStyleSourceList=1;
CPTableViewGridNone=0;
CPTableViewSolidVerticalGridLineMask=1<<0;
CPTableViewSolidHorizontalGridLineMask=1<<1;
CPTableViewNoColumnAutoresizing=0;
CPTableViewUniformColumnAutoresizingStyle=1;
CPTableViewSequentialColumnAutoresizingStyle=2;
CPTableViewReverseSequentialColumnAutoresizingStyle=3;
CPTableViewLastColumnOnlyAutoresizingStyle=4;
CPTableViewFirstColumnOnlyAutoresizingStyle=5;
var _1b=objj_allocateClassPair(CPView,"_CPTableDrawView"),_1c=_1b.isa;
class_addIvars(_1b,[new objj_ivar("_tableView")]);
objj_registerClassPair(_1b);
class_addMethods(_1b,[new objj_method(sel_getUid("initWithTableView:"),function(_1d,_1e,_1f){
with(_1d){
_1d=objj_msgSendSuper({receiver:_1d,super_class:objj_getClass("_CPTableDrawView").super_class},"init");
if(_1d){
_tableView=_1f;
}
return _1d;
}
}),new objj_method(sel_getUid("drawRect:"),function(_20,_21,_22){
with(_20){
var _23=objj_msgSend(_20,"frame"),_24=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort");
CGContextTranslateCTM(_24,-(_23.origin.x),-(_23.origin.y));
objj_msgSend(_tableView,"_drawRect:",_22);
}
})]);
var _1b=objj_allocateClassPair(CPControl,"CPTableView"),_1c=_1b.isa;
class_addIvars(_1b,[new objj_ivar("_dataSource"),new objj_ivar("_implementedDataSourceMethods"),new objj_ivar("_delegate"),new objj_ivar("_implementedDelegateMethods"),new objj_ivar("_tableColumns"),new objj_ivar("_tableColumnRanges"),new objj_ivar("_dirtyTableColumnRangeIndex"),new objj_ivar("_numberOfHiddenColumns"),new objj_ivar("_reloadAllRows"),new objj_ivar("_objectValues"),new objj_ivar("_exposedRows"),new objj_ivar("_exposedColumns"),new objj_ivar("_dataViewsForTableColumns"),new objj_ivar("_cachedDataViews"),new objj_ivar("_allowsColumnReordering"),new objj_ivar("_allowsColumnResizing"),new objj_ivar("_allowsColumnSelection"),new objj_ivar("_allowsMultipleSelection"),new objj_ivar("_allowsEmptySelection"),new objj_ivar("_sortDescriptors"),new objj_ivar("_intercellSpacing"),new objj_ivar("_rowHeight"),new objj_ivar("_usesAlternatingRowBackgroundColors"),new objj_ivar("_alternatingRowBackgroundColors"),new objj_ivar("_selectionHighlightStyle"),new objj_ivar("_currentHighlightedTableColumn"),new objj_ivar("_gridStyleMask"),new objj_ivar("_gridColor"),new objj_ivar("_numberOfRows"),new objj_ivar("_headerView"),new objj_ivar("_cornerView"),new objj_ivar("_selectedColumnIndexes"),new objj_ivar("_selectedRowIndexes"),new objj_ivar("_selectionAnchorRow"),new objj_ivar("_lastSelectedRow"),new objj_ivar("_previouslySelectedRowIndexes"),new objj_ivar("_startTrackingPoint"),new objj_ivar("_startTrackingTimestamp"),new objj_ivar("_trackingPointMovedOutOfClickSlop"),new objj_ivar("_editingCellIndex"),new objj_ivar("_tableDrawView"),new objj_ivar("_doubleAction"),new objj_ivar("_columnAutoResizingStyle"),new objj_ivar("_originalMouseDownPoint"),new objj_ivar("_verticalMotionCanDrag"),new objj_ivar("_destinationDragStyle"),new objj_ivar("_isSelectingSession"),new objj_ivar("_draggedRowIndexes"),new objj_ivar("_dropOperationFeedbackView"),new objj_ivar("_dragOperationDefaultMask"),new objj_ivar("_retargetedDropRow"),new objj_ivar("_retargetedDropOperation"),new objj_ivar("_disableAutomaticResizing"),new objj_ivar("_lastColumnShouldSnap"),new objj_ivar("_sourceListActiveGradient"),new objj_ivar("_sourceListActiveTopLineColor"),new objj_ivar("_sourceListActiveBottomLineColor")]);
objj_registerClassPair(_1b);
class_addMethods(_1b,[new objj_method(sel_getUid("disableAutomaticResizing"),function(_25,_26){
with(_25){
return _disableAutomaticResizing;
}
}),new objj_method(sel_getUid("setDisableAutomaticResizing:"),function(_27,_28,_29){
with(_27){
_disableAutomaticResizing=_29;
}
}),new objj_method(sel_getUid("initWithFrame:"),function(_2a,_2b,_2c){
with(_2a){
_2a=objj_msgSendSuper({receiver:_2a,super_class:objj_getClass("CPTableView").super_class},"initWithFrame:",_2c);
if(_2a){
_allowsColumnReordering=YES;
_allowsColumnResizing=YES;
_allowsMultipleSelection=NO;
_allowsEmptySelection=YES;
_allowsColumnSelection=NO;
_disableAutomaticResizing=NO;
_tableViewFlags=0;
_selectionHighlightStyle=CPTableViewSelectionHighlightStyleRegular;
objj_msgSend(_2a,"setUsesAlternatingRowBackgroundColors:",NO);
objj_msgSend(_2a,"setAlternatingRowBackgroundColors:",[objj_msgSend(CPColor,"whiteColor"),objj_msgSend(CPColor,"colorWithHexString:","f5f9fc")]);
_tableColumns=[];
_tableColumnRanges=[];
_dirtyTableColumnRangeIndex=CPNotFound;
_numberOfHiddenColumns=0;
_objectValues={};
_dataViewsForTableColumns={};
_dataViews=[];
_numberOfRows=0;
_exposedRows=objj_msgSend(CPIndexSet,"indexSet");
_exposedColumns=objj_msgSend(CPIndexSet,"indexSet");
_cachedDataViews={};
_intercellSpacing={width:0,height:0};
_rowHeight=23;
objj_msgSend(_2a,"setGridColor:",objj_msgSend(CPColor,"colorWithHexString:","dce0e2"));
objj_msgSend(_2a,"setGridStyleMask:",CPTableViewGridNone);
_headerView=objj_msgSend(objj_msgSend(CPTableHeaderView,"alloc"),"initWithFrame:",CGRectMake(0,0,objj_msgSend(_2a,"bounds").size.width,_rowHeight));
objj_msgSend(_headerView,"setTableView:",_2a);
_cornerView=objj_msgSend(objj_msgSend(_CPCornerView,"alloc"),"initWithFrame:",CGRectMake(0,0,objj_msgSend(CPScroller,"scrollerWidth"),CGRectGetHeight(objj_msgSend(_headerView,"frame"))));
_lastSelectedRow=-1;
_selectedColumnIndexes=objj_msgSend(CPIndexSet,"indexSet");
_selectedRowIndexes=objj_msgSend(CPIndexSet,"indexSet");
_currentHighlightedTableColumn=nil;
_sortDescriptors=objj_msgSend(CPArray,"array");
_draggedRowIndexes=objj_msgSend(CPIndexSet,"indexSet");
_verticalMotionCanDrag=YES;
_isSelectingSession=NO;
_retargetedDropRow=nil;
_retargetedDropOperation=nil;
_dragOperationDefaultMask=nil;
_destinationDragStyle=CPTableViewDraggingDestinationFeedbackStyleRegular;
_tableDrawView=objj_msgSend(objj_msgSend(_CPTableDrawView,"alloc"),"initWithTableView:",_2a);
objj_msgSend(_tableDrawView,"setBackgroundColor:",objj_msgSend(CPColor,"clearColor"));
objj_msgSend(_2a,"addSubview:",_tableDrawView);
objj_msgSend(_2a,"_init");
}
return _2a;
}
}),new objj_method(sel_getUid("_init"),function(_2d,_2e){
with(_2d){
_dropOperationFeedbackView=objj_msgSend(objj_msgSend(_dropOperationDrawingView,"alloc"),"initWithFrame:",{origin:{x:0,y:0},size:{width:0,height:0}});
objj_msgSend(_dropOperationFeedbackView,"setTableView:",_2d);
_lastColumnShouldSnap=NO;
_backgroundColor=objj_msgSend(CPColor,"whiteColor");
_sourceListActiveGradient=CGGradientCreateWithColorComponents(CGColorSpaceCreateDeviceRGB(),[89/255,153/255,209/255,1,33/255,94/255,208/255,1],[0,1],2);
_sourceListActiveTopLineColor=objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",(61/255),(123/255),(218/255),1);
_sourceListActiveBottomLineColor=objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",(31/255),(92/255),(207/255),1);
}
}),new objj_method(sel_getUid("setDataSource:"),function(_2f,_30,_31){
with(_2f){
if(_dataSource===_31){
return;
}
_dataSource=_31;
_implementedDataSourceMethods=0;
if(!_dataSource){
return;
}
if(!objj_msgSend(_dataSource,"respondsToSelector:",sel_getUid("numberOfRowsInTableView:"))){
objj_msgSend(CPException,"raise:reason:",CPInternalInconsistencyException,objj_msgSend(_31,"description")+" does not implement numberOfRowsInTableView:.");
}
if(!objj_msgSend(_dataSource,"respondsToSelector:",sel_getUid("tableView:objectValueForTableColumn:row:"))){
objj_msgSend(CPException,"raise:reason:",CPInternalInconsistencyException,objj_msgSend(_31,"description")+" does not implement tableView:objectValueForTableColumn:row:");
}
if(objj_msgSend(_dataSource,"respondsToSelector:",sel_getUid("tableView:setObjectValue:forTableColumn:row:"))){
_implementedDataSourceMethods|=_1;
}
if(objj_msgSend(_dataSource,"respondsToSelector:",sel_getUid("tableView:acceptDrop:row:dropOperation:"))){
_implementedDataSourceMethods|=_2;
}
if(objj_msgSend(_dataSource,"respondsToSelector:",sel_getUid("tableView:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:"))){
_implementedDataSourceMethods|=_3;
}
if(objj_msgSend(_dataSource,"respondsToSelector:",sel_getUid("tableView:validateDrop:proposedRow:proposedDropOperation:"))){
_implementedDataSourceMethods|=_4;
}
if(objj_msgSend(_dataSource,"respondsToSelector:",sel_getUid("tableView:writeRowsWithIndexes:toPasteboard:"))){
_implementedDataSourceMethods|=_5;
}
if(objj_msgSend(_dataSource,"respondsToSelector:",sel_getUid("tableView:sortDescriptorsDidChange:"))){
_implementedDataSourceMethods|=_6;
}
objj_msgSend(_2f,"reloadData");
}
}),new objj_method(sel_getUid("dataSource"),function(_32,_33){
with(_32){
return _dataSource;
}
}),new objj_method(sel_getUid("reloadDataForRowIndexes:columnIndexes:"),function(_34,_35,_36,_37){
with(_34){
objj_msgSend(_34,"reloadData");
}
}),new objj_method(sel_getUid("reloadData"),function(_38,_39){
with(_38){
if(!_dataSource){
return;
}
_reloadAllRows=YES;
_objectValues={};
objj_msgSend(_38,"noteNumberOfRowsChanged");
objj_msgSend(_38,"setNeedsLayout");
objj_msgSend(_38,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("setDoubleAction:"),function(_3a,_3b,_3c){
with(_3a){
_doubleAction=_3c;
}
}),new objj_method(sel_getUid("doubleAction"),function(_3d,_3e){
with(_3d){
return _doubleAction;
}
}),new objj_method(sel_getUid("setAllowsColumnReordering:"),function(_3f,_40,_41){
with(_3f){
_allowsColumnReordering=!!_41;
}
}),new objj_method(sel_getUid("allowsColumnReordering"),function(_42,_43){
with(_42){
return _allowsColumnReordering;
}
}),new objj_method(sel_getUid("setAllowsColumnResizing:"),function(_44,_45,_46){
with(_44){
_allowsColumnResizing=!!_46;
}
}),new objj_method(sel_getUid("allowsColumnResizing"),function(_47,_48){
with(_47){
return _allowsColumnResizing;
}
}),new objj_method(sel_getUid("setAllowsMultipleSelection:"),function(_49,_4a,_4b){
with(_49){
_allowsMultipleSelection=!!_4b;
}
}),new objj_method(sel_getUid("allowsMultipleSelection"),function(_4c,_4d){
with(_4c){
return _allowsMultipleSelection;
}
}),new objj_method(sel_getUid("setAllowsEmptySelection:"),function(_4e,_4f,_50){
with(_4e){
_allowsEmptySelection=!!_50;
}
}),new objj_method(sel_getUid("allowsEmptySelection"),function(_51,_52){
with(_51){
return _allowsEmptySelection;
}
}),new objj_method(sel_getUid("setAllowsColumnSelection:"),function(_53,_54,_55){
with(_53){
_allowsColumnSelection=!!_55;
}
}),new objj_method(sel_getUid("allowsColumnSelection"),function(_56,_57){
with(_56){
return _allowsColumnSelection;
}
}),new objj_method(sel_getUid("setIntercellSpacing:"),function(_58,_59,_5a){
with(_58){
if((_intercellSpacing.width==_5a.width&&_intercellSpacing.height==_5a.height)){
return;
}
_intercellSpacing={width:_5a.width,height:_5a.height};
objj_msgSend(_58,"setNeedsLayout");
}
}),new objj_method(sel_getUid("setThemeState:"),function(_5b,_5c,_5d){
with(_5b){
}
}),new objj_method(sel_getUid("intercellSpacing"),function(_5e,_5f){
with(_5e){
return {width:_intercellSpacing.width,height:_intercellSpacing.height};
}
}),new objj_method(sel_getUid("setRowHeight:"),function(_60,_61,_62){
with(_60){
_62=+_62;
if(_rowHeight===_62){
return;
}
_rowHeight=MAX(0,_62);
objj_msgSend(_60,"setNeedsLayout");
}
}),new objj_method(sel_getUid("rowHeight"),function(_63,_64){
with(_63){
return _rowHeight;
}
}),new objj_method(sel_getUid("setUsesAlternatingRowBackgroundColors:"),function(_65,_66,_67){
with(_65){
_usesAlternatingRowBackgroundColors=_67;
}
}),new objj_method(sel_getUid("usesAlternatingRowBackgroundColors"),function(_68,_69){
with(_68){
return _usesAlternatingRowBackgroundColors;
}
}),new objj_method(sel_getUid("setAlternatingRowBackgroundColors:"),function(_6a,_6b,_6c){
with(_6a){
if(objj_msgSend(_alternatingRowBackgroundColors,"isEqual:",_6c)){
return;
}
_alternatingRowBackgroundColors=_6c;
objj_msgSend(_6a,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("alternatingRowBackgroundColors"),function(_6d,_6e){
with(_6d){
return _alternatingRowBackgroundColors;
}
}),new objj_method(sel_getUid("selectionHighlightStyle"),function(_6f,_70){
with(_6f){
return _selectionHighlightStyle;
}
}),new objj_method(sel_getUid("setSelectionHighlightStyle:"),function(_71,_72,_73){
with(_71){
if(_73==CPTableViewSelectionHighlightStyleSourceList&&!CPFeatureIsCompatible(CPHTMLCanvasFeature)){
return;
}
_selectionHighlightStyle=_73;
if(_73===CPTableViewSelectionHighlightStyleSourceList){
_destinationDragStyle=CPTableViewDraggingDestinationFeedbackStyleSourceList;
}else{
_destinationDragStyle=CPTableViewDraggingDestinationFeedbackStyleRegular;
}
}
}),new objj_method(sel_getUid("setGridColor:"),function(_74,_75,_76){
with(_74){
if(_gridColor===_76){
return;
}
_gridColor=_76;
objj_msgSend(_74,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("gridColor"),function(_77,_78){
with(_77){
return _gridColor;
}
}),new objj_method(sel_getUid("setGridStyleMask:"),function(_79,_7a,_7b){
with(_79){
if(_gridStyleMask===_7b){
return;
}
_gridStyleMask=_7b;
objj_msgSend(_79,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("gridStyleMask"),function(_7c,_7d){
with(_7c){
return _gridStyleMask;
}
}),new objj_method(sel_getUid("addTableColumn:"),function(_7e,_7f,_80){
with(_7e){
objj_msgSend(_tableColumns,"addObject:",_80);
objj_msgSend(_80,"setTableView:",_7e);
if(_dirtyTableColumnRangeIndex<0){
_dirtyTableColumnRangeIndex=(_tableColumns.length)-1;
}else{
_dirtyTableColumnRangeIndex=MIN((_tableColumns.length)-1,_dirtyTableColumnRangeIndex);
}
objj_msgSend(_7e,"setNeedsLayout");
}
}),new objj_method(sel_getUid("removeTableColumn:"),function(_81,_82,_83){
with(_81){
if(objj_msgSend(_83,"tableView")!==_81){
return;
}
var _84=objj_msgSend(_tableColumns,"indexOfObjectIdenticalTo:",_83);
if(_84===CPNotFound){
return;
}
objj_msgSend(_83,"setTableView:",nil);
objj_msgSend(_tableColumns,"removeObjectAtIndex:",_84);
var _85=objj_msgSend(_83,"UID");
if(_objectValues[_85]){
_objectValues[_85]=nil;
}
if(_dirtyTableColumnRangeIndex<0){
_dirtyTableColumnRangeIndex=_84;
}else{
_dirtyTableColumnRangeIndex=MIN(_84,_dirtyTableColumnRangeIndex);
}
objj_msgSend(_81,"setNeedsLayout");
}
}),new objj_method(sel_getUid("moveColumn:toColumn:"),function(_86,_87,_88,_89){
with(_86){
_88=+_88;
_89=+_89;
if(_88===_89){
return;
}
if(_dirtyTableColumnRangeIndex<0){
_dirtyTableColumnRangeIndex=MIN(_88,_89);
}else{
_dirtyTableColumnRangeIndex=MIN(_88,_89,_dirtyTableColumnRangeIndex);
}
if(_89>_88){
--_89;
}
var _8a=_tableColumns[_88];
objj_msgSend(_tableColumns,"removeObjectAtIndex:",_88);
objj_msgSend(_tableColumns,"insertObject:atIndex:",_8a,_89);
objj_msgSend(_86,"setNeedsLayout");
}
}),new objj_method(sel_getUid("tableColumns"),function(_8b,_8c){
with(_8b){
return _tableColumns;
}
}),new objj_method(sel_getUid("columnWithIdentifier:"),function(_8d,_8e,_8f){
with(_8d){
var _90=0,_91=(_tableColumns.length);
for(;_90<_91;++_90){
if(objj_msgSend(_tableColumns[_90],"identifier")===_8f){
return _90;
}
}
return CPNotFound;
}
}),new objj_method(sel_getUid("tableColumnWithIdentifier:"),function(_92,_93,_94){
with(_92){
var _95=objj_msgSend(_92,"columnWithIdentifier:",_94);
if(_95===CPNotFound){
return nil;
}
return _tableColumns[_95];
}
}),new objj_method(sel_getUid("selectColumnIndexes:byExtendingSelection:"),function(_96,_97,_98,_99){
with(_96){
if((objj_msgSend(_98,"firstIndex")!=CPNotFound&&objj_msgSend(_98,"firstIndex")<0)||objj_msgSend(_98,"lastIndex")>=objj_msgSend(_96,"numberOfColumns")){
return;
}
if(objj_msgSend(_selectedRowIndexes,"count")>0){
objj_msgSend(_96,"_updateHighlightWithOldRows:newRows:",_selectedRowIndexes,objj_msgSend(CPIndexSet,"indexSet"));
_selectedRowIndexes=objj_msgSend(CPIndexSet,"indexSet");
}
var _9a=objj_msgSend(_selectedColumnIndexes,"copy");
if(_99){
objj_msgSend(_selectedColumnIndexes,"addIndexes:",_98);
}else{
_selectedColumnIndexes=objj_msgSend(_98,"copy");
}
objj_msgSend(_96,"_updateHighlightWithOldColumns:newColumns:",_9a,_selectedColumnIndexes);
objj_msgSend(_tableDrawView,"display");
if(_headerView){
objj_msgSend(_headerView,"setNeedsDisplay:",YES);
}
objj_msgSend(_96,"_noteSelectionDidChange");
}
}),new objj_method(sel_getUid("selectRowIndexes:byExtendingSelection:"),function(_9b,_9c,_9d,_9e){
with(_9b){
if(objj_msgSend(_9d,"isEqualToIndexSet:",_selectedRowIndexes)||((objj_msgSend(_9d,"firstIndex")!=CPNotFound&&objj_msgSend(_9d,"firstIndex")<0)||objj_msgSend(_9d,"lastIndex")>=objj_msgSend(_9b,"numberOfRows"))){
return;
}
if(objj_msgSend(_selectedColumnIndexes,"count")>0){
objj_msgSend(_9b,"_updateHighlightWithOldColumns:newColumns:",_selectedColumnIndexes,objj_msgSend(CPIndexSet,"indexSet"));
_selectedColumnIndexes=objj_msgSend(CPIndexSet,"indexSet");
if(_headerView){
objj_msgSend(_headerView,"setNeedsDisplay:",YES);
}
}
var _9f=objj_msgSend(_selectedRowIndexes,"copy");
if(_9e){
objj_msgSend(_selectedRowIndexes,"addIndexes:",_9d);
}else{
_selectedRowIndexes=objj_msgSend(_9d,"copy");
}
objj_msgSend(_9b,"_updateHighlightWithOldRows:newRows:",_9f,_selectedRowIndexes);
objj_msgSend(_tableDrawView,"display");
objj_msgSend(_9b,"_noteSelectionDidChange");
}
}),new objj_method(sel_getUid("_updateHighlightWithOldRows:newRows:"),function(_a0,_a1,_a2,_a3){
with(_a0){
var _a4=objj_msgSend(_exposedRows,"firstIndex"),_a5=objj_msgSend(_exposedRows,"lastIndex")-_a4+1,_a6=[],_a7=[],_a8=objj_msgSend(_a2,"copy"),_a9=objj_msgSend(_a3,"copy");
objj_msgSend(_a8,"removeMatches:",_a9);
objj_msgSend(_a8,"getIndexes:maxCount:inIndexRange:",_a6,-1,CPMakeRange(_a4,_a5));
objj_msgSend(_a9,"getIndexes:maxCount:inIndexRange:",_a7,-1,CPMakeRange(_a4,_a5));
for(var _aa in _dataViewsForTableColumns){
var _ab=_dataViewsForTableColumns[_aa];
var _ac=_a6.length;
while(_ac--){
var _ad=_a6[_ac];
var _ae=_ab[_ad];
objj_msgSend(_ae,"unsetThemeState:",CPThemeStateSelected);
}
_ac=_a7.length;
while(_ac--){
var _ad=_a7[_ac];
var _ae=_ab[_ad];
objj_msgSend(_ae,"setThemeState:",CPThemeStateSelected);
}
}
}
}),new objj_method(sel_getUid("_updateHighlightWithOldColumns:newColumns:"),function(_af,_b0,_b1,_b2){
with(_af){
var _b3=objj_msgSend(_exposedColumns,"firstIndex"),_b4=objj_msgSend(_exposedColumns,"lastIndex")-_b3+1,_b5=[],_b6=[],_b7=objj_msgSend(_b1,"copy"),_b8=objj_msgSend(_b2,"copy"),_b9=[];
objj_msgSend(_b7,"removeMatches:",_b8);
objj_msgSend(_b7,"getIndexes:maxCount:inIndexRange:",_b5,-1,CPMakeRange(_b3,_b4));
objj_msgSend(_b8,"getIndexes:maxCount:inIndexRange:",_b6,-1,CPMakeRange(_b3,_b4));
objj_msgSend(_exposedRows,"getIndexes:maxCount:inIndexRange:",_b9,-1,nil);
var _ba=_b9.length,_bb=_b5.length;
while(_bb--){
var _bc=_b5[_bb],_bd=objj_msgSend(_tableColumns[_bc],"UID"),_be=_dataViewsForTableColumns[_bd];
for(var i=0;i<_ba;i++){
var _bf=_b9[i],_c0=_be[_bf];
objj_msgSend(_c0,"unsetThemeState:",CPThemeStateSelected);
}
if(_headerView){
var _c1=objj_msgSend(_tableColumns[_bc],"headerView");
objj_msgSend(_c1,"unsetThemeState:",CPThemeStateSelected);
}
}
_bb=_b6.length;
while(_bb--){
var _bc=_b6[_bb],_bd=objj_msgSend(_tableColumns[_bc],"UID"),_be=_dataViewsForTableColumns[_bd];
for(var i=0;i<_ba;i++){
var _bf=_b9[i],_c0=_be[_bf];
objj_msgSend(_c0,"setThemeState:",CPThemeStateSelected);
}
if(_headerView){
var _c1=objj_msgSend(_tableColumns[_bc],"headerView");
objj_msgSend(_c1,"setThemeState:",CPThemeStateSelected);
}
}
}
}),new objj_method(sel_getUid("selectedColumn"),function(_c2,_c3){
with(_c2){
objj_msgSend(_selectedColumnIndexes,"lastIndex");
}
}),new objj_method(sel_getUid("selectedColumnIndexes"),function(_c4,_c5){
with(_c4){
return _selectedColumnIndexes;
}
}),new objj_method(sel_getUid("selectedRow"),function(_c6,_c7){
with(_c6){
return objj_msgSend(_selectedRowIndexes,"lastIndex");
}
}),new objj_method(sel_getUid("selectedRowIndexes"),function(_c8,_c9){
with(_c8){
return _selectedRowIndexes;
}
}),new objj_method(sel_getUid("deselectColumn:"),function(_ca,_cb,_cc){
with(_ca){
var _cd=objj_msgSend(_selectedColumnIndexes,"copy");
objj_msgSend(_cd,"removeIndex:",_cc);
objj_msgSend(_ca,"selectColumnIndexes:byExtendingSelection:",_cd,NO);
objj_msgSend(_ca,"_noteSelectionDidChange");
}
}),new objj_method(sel_getUid("deselectRow:"),function(_ce,_cf,_d0){
with(_ce){
var _d1=objj_msgSend(_selectedRowIndexes,"copy");
objj_msgSend(_d1,"removeIndex:",_d0);
objj_msgSend(_ce,"selectRowIndexes:byExtendingSelection:",_d1,NO);
objj_msgSend(_ce,"_noteSelectionDidChange");
}
}),new objj_method(sel_getUid("numberOfSelectedColumns"),function(_d2,_d3){
with(_d2){
return objj_msgSend(_selectedColumnIndexes,"count");
}
}),new objj_method(sel_getUid("numberOfSelectedRows"),function(_d4,_d5){
with(_d4){
return objj_msgSend(_selectedRowIndexes,"count");
}
}),new objj_method(sel_getUid("isColumnSelected:"),function(_d6,_d7,_d8){
with(_d6){
return objj_msgSend(_selectedColumnIndexes,"containsIndex:",_d8);
}
}),new objj_method(sel_getUid("isRowSelected:"),function(_d9,_da,_db){
with(_d9){
return objj_msgSend(_selectedRowIndexes,"containsIndex:",_db);
}
}),new objj_method(sel_getUid("deselectAll"),function(_dc,_dd){
with(_dc){
objj_msgSend(_dc,"selectRowIndexes:byExtendingSelection:",objj_msgSend(CPIndexSet,"indexSet"),NO);
objj_msgSend(_dc,"selectColumnIndexes:byExtendingSelection:",objj_msgSend(CPIndexSet,"indexSet"),NO);
}
}),new objj_method(sel_getUid("numberOfColumns"),function(_de,_df){
with(_de){
return (_tableColumns.length);
}
}),new objj_method(sel_getUid("numberOfRows"),function(_e0,_e1){
with(_e0){
if(!_dataSource){
return 0;
}
return objj_msgSend(_dataSource,"numberOfRowsInTableView:",_e0);
}
}),new objj_method(sel_getUid("cornerView"),function(_e2,_e3){
with(_e2){
return _cornerView;
}
}),new objj_method(sel_getUid("setCornerView:"),function(_e4,_e5,_e6){
with(_e4){
if(_cornerView===_e6){
return;
}
_cornerView=_e6;
var _e7=objj_msgSend(objj_msgSend(_e4,"superview"),"superview");
if(objj_msgSend(_e7,"isKindOfClass:",objj_msgSend(CPScrollView,"class"))&&objj_msgSend(_e7,"documentView")===_e4){
objj_msgSend(_e7,"_updateCornerAndHeaderView");
}
}
}),new objj_method(sel_getUid("headerView"),function(_e8,_e9){
with(_e8){
return _headerView;
}
}),new objj_method(sel_getUid("setHeaderView:"),function(_ea,_eb,_ec){
with(_ea){
if(_headerView===_ec){
return;
}
objj_msgSend(_headerView,"setTableView:",nil);
_headerView=_ec;
if(_headerView){
objj_msgSend(_headerView,"setTableView:",_ea);
objj_msgSend(_headerView,"setFrameSize:",{width:(objj_msgSend(_ea,"frame").size.width),height:(objj_msgSend(_headerView,"frame").size.height)});
}
var _ed=objj_msgSend(objj_msgSend(_ea,"superview"),"superview");
if(objj_msgSend(_ed,"isKindOfClass:",objj_msgSend(CPScrollView,"class"))&&objj_msgSend(_ed,"documentView")===_ea){
objj_msgSend(_ed,"_updateCornerAndHeaderView");
}
}
}),new objj_method(sel_getUid("_recalculateTableColumnRanges"),function(_ee,_ef){
with(_ee){
if(_dirtyTableColumnRangeIndex<0){
return;
}
var _f0=_dirtyTableColumnRangeIndex,_f1=(_tableColumns.length),x=_f0===0?0:CPMaxRange(_tableColumnRanges[_f0-1]);
for(;_f0<_f1;++_f0){
var _f2=_tableColumns[_f0];
if(objj_msgSend(_f2,"isHidden")){
_tableColumnRanges[_f0]=CPMakeRange(x,0);
}else{
var _f3=objj_msgSend(_tableColumns[_f0],"width");
_tableColumnRanges[_f0]=CPMakeRange(x,_f3);
x+=_f3;
}
}
_tableColumnRanges.length=_f1;
_dirtyTableColumnRangeIndex=CPNotFound;
}
}),new objj_method(sel_getUid("rectOfColumn:"),function(_f4,_f5,_f6){
with(_f4){
_f6=+_f6;
if(_f6<0||_f6>=(_tableColumns.length)){
return {origin:{x:0,y:0},size:{width:0,height:0}};
}
if(_dirtyTableColumnRangeIndex!==CPNotFound){
objj_msgSend(_f4,"_recalculateTableColumnRanges");
}
var _f7=_tableColumnRanges[_f6];
return {origin:{x:_f7.location,y:0},size:{width:_f7.length,height:CGRectGetHeight(objj_msgSend(_f4,"bounds"))}};
}
}),new objj_method(sel_getUid("rectOfRow:"),function(_f8,_f9,_fa){
with(_f8){
if(NO){
return NULL;
}
return {origin:{x:0,y:(_fa*(_rowHeight+_intercellSpacing.height))},size:{width:(objj_msgSend(_f8,"bounds").size.width),height:_rowHeight}};
}
}),new objj_method(sel_getUid("rowsInRect:"),function(_fb,_fc,_fd){
with(_fb){
if(_numberOfRows<=0){
return CPMakeRange(0,0);
}
var _fe=objj_msgSend(_fb,"bounds");
if(!CGRectIntersectsRect(_fd,_fe)){
return CPMakeRange(0,0);
}
var _ff=objj_msgSend(_fb,"rowAtPoint:",_fd.origin);
if(_ff<0){
_ff=0;
}
var _100=objj_msgSend(_fb,"rowAtPoint:",{x:0,y:(_fd.origin.y+_fd.size.height)});
if(_100<0){
_100=_numberOfRows-1;
}
return CPMakeRange(_ff,_100-_ff+1);
}
}),new objj_method(sel_getUid("columnIndexesInRect:"),function(self,_101,_102){
with(self){
var _103=MAX(0,objj_msgSend(self,"columnAtPoint:",{x:_102.origin.x,y:0})),_104=objj_msgSend(self,"columnAtPoint:",{x:(_102.origin.x+_102.size.width),y:0});
if(_104===CPNotFound){
_104=(_tableColumns.length)-1;
}
if(_numberOfHiddenColumns<=0){
return objj_msgSend(CPIndexSet,"indexSetWithIndexesInRange:",CPMakeRange(_103,_104-_103+1));
}
var _105=objj_msgSend(CPIndexSet,"indexSet");
for(;_103<=_104;++_103){
var _106=_tableColumns[_103];
if(!objj_msgSend(_106,"isHidden")){
objj_msgSend(_105,"addIndex:",_103);
}
}
return _105;
}
}),new objj_method(sel_getUid("columnAtPoint:"),function(self,_107,_108){
with(self){
var _109=objj_msgSend(self,"bounds");
if(!(_108.x>=(_109.origin.x)&&_108.y>=(_109.origin.y)&&_108.x<(_109.origin.x+_109.size.width)&&_108.y<(_109.origin.y+_109.size.height))){
return CPNotFound;
}
if(_dirtyTableColumnRangeIndex!==CPNotFound){
objj_msgSend(self,"_recalculateTableColumnRanges");
}
var x=_108.x,low=0,high=_tableColumnRanges.length-1;
while(low<=high){
var _10a=FLOOR(low+(high-low)/2),_10b=_tableColumnRanges[_10a];
if(x<_10b.location){
high=_10a-1;
}else{
if(x>=CPMaxRange(_10b)){
low=_10a+1;
}else{
var _10c=_tableColumnRanges.length;
while(_10a<_10c&&objj_msgSend(_tableColumns[_10a],"isHidden")){
++_10a;
}
if(_10a<_10c){
return _10a;
}
return CPNotFound;
}
}
}
return CPNotFound;
}
}),new objj_method(sel_getUid("rowAtPoint:"),function(self,_10d,_10e){
with(self){
var y=_10e.y;
var row=FLOOR(y/(_rowHeight+_intercellSpacing.height));
if(row>=_numberOfRows){
return -1;
}
return row;
}
}),new objj_method(sel_getUid("frameOfDataViewAtColumn:row:"),function(self,_10f,_110,aRow){
with(self){
if(_dirtyTableColumnRangeIndex!==CPNotFound){
objj_msgSend(self,"_recalculateTableColumnRanges");
}
var _111=_tableColumnRanges[_110],_112=objj_msgSend(self,"rectOfRow:",aRow);
return {origin:{x:_111.location,y:(_112.origin.y)},size:{width:_111.length,height:(_112.size.height)}};
}
}),new objj_method(sel_getUid("resizeWithOldSuperviewSize:"),function(self,_113,_114){
with(self){
objj_msgSendSuper({receiver:self,super_class:objj_getClass("CPTableView").super_class},"resizeWithOldSuperviewSize:",_114);
if(_disableAutomaticResizing){
return;
}
var mask=_columnAutoResizingStyle;
if(mask===CPTableViewUniformColumnAutoresizingStyle){
objj_msgSend(self,"_resizeAllColumnUniformlyWithOldSize:",_114);
}
if(mask===CPTableViewLastColumnOnlyAutoresizingStyle){
objj_msgSend(self,"sizeLastColumnToFit");
}
if(mask===CPTableViewFirstColumnOnlyAutoresizingStyle){
var _115=objj_msgSend(self,"superview");
if(!_115){
return;
}
var _116=objj_msgSend(_115,"bounds").size;
if(_dirtyTableColumnRangeIndex!==CPNotFound){
objj_msgSend(self,"_recalculateTableColumnRanges");
}
var _117=(_tableColumns.length);
var _118=objj_msgSend(objj_msgSend(CPArray,"alloc"),"init");
var _119=0;
for(var i=0;i<_117;i++){
if(!objj_msgSend(_tableColumns[i],"isHidden")){
objj_msgSend(_118,"addObject:",i);
_119+=objj_msgSend(_tableColumns[i],"width");
}
}
_117=objj_msgSend(_118,"count");
if(_117>0){
var _11a=_tableColumns[_118[0]];
var _11b=_116.width-_119;
_11b+=objj_msgSend(_11a,"width");
_11b=(_11b<objj_msgSend(_11a,"minWidth"))?objj_msgSend(_11a,"minWidth"):_11b;
_11b=(_11b>objj_msgSend(_11a,"maxWidth"))?objj_msgSend(_11a,"maxWidth"):_11b;
objj_msgSend(_11a,"setWidth:",FLOOR(_11b));
}
objj_msgSend(self,"setNeedsLayout");
}
}
}),new objj_method(sel_getUid("_resizeAllColumnUniformlyWithOldSize:"),function(self,_11c,_11d){
with(self){
var _11e=objj_msgSend(self,"superview");
if(!_11e){
return;
}
var _11f=objj_msgSend(_11e,"bounds").size;
if(_dirtyTableColumnRangeIndex!==CPNotFound){
objj_msgSend(self,"_recalculateTableColumnRanges");
}
var _120=_tableColumns.length,_121=objj_msgSend(objj_msgSend(CPArray,"alloc"),"init"),_122=0;
for(var i=0;i<_120;i++){
var _123=_tableColumns[i];
if(!objj_msgSend(_123,"isHidden")&&(objj_msgSend(_123,"resizingMask")&CPTableColumnAutoresizingMask)){
objj_msgSend(_121,"addObject:",i);
}
}
_120=objj_msgSend(_121,"count");
if(_120>0){
var _124=CGRectGetMaxX(objj_msgSend(self,"rectOfColumn:",_121[_120-1]));
if(!_lastColumnShouldSnap&&(_124>=_11f.width&&_124<=_11d.width||_124<=_11f.width&&_124>=_11d.width)){
_lastColumnShouldSnap=YES;
objj_msgSend(self,"_resizeAllColumnUniformlyWithOldSize:",CGSizeMake(_124,0));
}
if(!_lastColumnShouldSnap){
return;
}
for(var i=0;i<_120;i++){
var _125=_121[i];
columnToResize=_tableColumns[_125],currentBuffer=_122/(_120-i),realNewWidth=(objj_msgSend(columnToResize,"width")/_11d.width*objj_msgSend(_11e,"bounds").size.width)+currentBuffer,newWidth=MAX(objj_msgSend(columnToResize,"minWidth"),realNewWidth);
newWidth=MIN(objj_msgSend(columnToResize,"maxWidth"),realNewWidth);
_122-=currentBuffer;
_122+=realNewWidth-newWidth;
objj_msgSend(columnToResize,"setWidth:",newWidth);
}
if(_122!==0){
_lastColumnShouldSnap=NO;
}
}
objj_msgSend(self,"setNeedsLayout");
}
}),new objj_method(sel_getUid("setColumnAutoresizingStyle:"),function(self,_126,_127){
with(self){
_columnAutoResizingStyle=_127;
}
}),new objj_method(sel_getUid("columnAutoresizingStyle"),function(self,_128){
with(self){
return _columnAutoResizingStyle;
}
}),new objj_method(sel_getUid("sizeLastColumnToFit"),function(self,_129){
with(self){
var _12a=objj_msgSend(self,"superview");
if(!_12a){
return;
}
var _12b=objj_msgSend(_12a,"bounds").size;
if(_dirtyTableColumnRangeIndex!==CPNotFound){
objj_msgSend(self,"_recalculateTableColumnRanges");
}
var _12c=(_tableColumns.length);
while(_12c--&&objj_msgSend(_tableColumns[_12c],"isHidden")){
}
if(_12c>=0){
var _12d=_tableColumns[_12c];
var _12e=MAX(0,_12b.width-CGRectGetMinX(objj_msgSend(self,"rectOfColumn:",_12c)));
if(_12e>0){
_12e=MAX(objj_msgSend(_12d,"minWidth"),_12e);
_12e=MIN(objj_msgSend(_12d,"maxWidth"),_12e);
objj_msgSend(_12d,"setWidth:",_12e);
}
}
objj_msgSend(self,"setNeedsLayout");
}
}),new objj_method(sel_getUid("noteNumberOfRowsChanged"),function(self,_12f){
with(self){
_numberOfRows=objj_msgSend(_dataSource,"numberOfRowsInTableView:",self);
objj_msgSend(self,"tile");
}
}),new objj_method(sel_getUid("tile"),function(self,_130){
with(self){
if(_dirtyTableColumnRangeIndex!==CPNotFound){
objj_msgSend(self,"_recalculateTableColumnRanges");
}
var _131=_tableColumnRanges.length>0?CPMaxRange(objj_msgSend(_tableColumnRanges,"lastObject")):0,_132=(_rowHeight+_intercellSpacing.height)*_numberOfRows,_133=objj_msgSend(self,"superview");
if(objj_msgSend(_133,"isKindOfClass:",objj_msgSend(CPClipView,"class"))){
var _134=objj_msgSend(_133,"bounds").size;
_131=MAX(_134.width,_131);
_132=MAX(_134.height,_132);
}
objj_msgSend(self,"setFrameSize:",{width:_131,height:_132});
objj_msgSend(self,"setNeedsLayout");
objj_msgSend(self,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("scrollRowToVisible:"),function(self,_135,_136){
with(self){
objj_msgSend(self,"scrollRectToVisible:",objj_msgSend(self,"rectOfRow:",_136));
}
}),new objj_method(sel_getUid("scrollColumnToVisible:"),function(self,_137,_138){
with(self){
objj_msgSend(self,"scrollRectToVisible:",objj_msgSend(self,"rectOfColumn:",_138));
}
}),new objj_method(sel_getUid("setDelegate:"),function(self,_139,_13a){
with(self){
if(_delegate===_13a){
return;
}
var _13b=objj_msgSend(CPNotificationCenter,"defaultCenter");
if(_delegate){
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableViewColumnDidMove:"))){
objj_msgSend(_13b,"removeObserver:name:object:",_delegate,CPTableViewColumnDidMoveNotification,self);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableViewColumnDidResize:"))){
objj_msgSend(_13b,"removeObserver:name:object:",_delegate,CPTableViewColumnDidResizeNotification,self);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableViewSelectionDidChange:"))){
objj_msgSend(_13b,"removeObserver:name:object:",_delegate,CPTableViewSelectionDidChangeNotification,self);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableViewSelectionIsChanging:"))){
objj_msgSend(_13b,"removeObserver:name:object:",_delegate,CPTableViewSelectionIsChangingNotification,self);
}
}
_delegate=_13a;
_implementedDelegateMethods=0;
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("selectionShouldChangeInTableView:"))){
_implementedDelegateMethods|=_7;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableView:dataViewForTableColumn:row:"))){
_implementedDelegateMethods|=_8;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableView:didClickTableColumn:"))){
_implementedDelegateMethods|=_9;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableView:didDragTableColumn:"))){
_implementedDelegateMethods|=_a;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableView:heightOfRow:"))){
_implementedDelegateMethods|=_b;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableView:isGroupRow:"))){
_implementedDelegateMethods|=_c;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableView:mouseDownInHeaderOfTableColumn:"))){
_implementedDelegateMethods|=_d;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableView:nextTypeSelectMatchFromRow:toRow:forString:"))){
_implementedDelegateMethods|=_e;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableView:selectionIndexesForProposedSelection:"))){
_implementedDelegateMethods|=_f;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableView:shouldEditTableColumn:row:"))){
_implementedDelegateMethods|=_10;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableView:shouldSelectRow:"))){
_implementedDelegateMethods|=_11;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableView:shouldSelectTableColumn:"))){
_implementedDelegateMethods|=_12;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableView:shouldShowViewExpansionForTableColumn:row:"))){
_implementedDelegateMethods|=_13;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableView:shouldTrackView:forTableColumn:row:"))){
_implementedDelegateMethods|=_14;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableView:shouldTypeSelectForEvent:withCurrentSearchString:"))){
_implementedDelegateMethods|=_15;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableView:toolTipForView:rect:tableColumn:row:mouseLocation:"))){
_implementedDelegateMethods|=_16;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableView:typeSelectStringForTableColumn:row:"))){
_implementedDelegateMethods|=_17;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableView:willDisplayView:forTableColumn:row:"))){
_implementedDelegateMethods|=_18;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableViewColumnDidMove:"))){
objj_msgSend(_13b,"addObserver:selector:name:object:",_delegate,sel_getUid("tableViewColumnDidMove:"),CPTableViewColumnDidMoveNotification,self);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableViewColumnDidResize:"))){
objj_msgSend(_13b,"addObserver:selector:name:object:",_delegate,sel_getUid("tableViewColumnDidResize:"),CPTableViewColumnDidResizeNotification,self);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableViewSelectionDidChange:"))){
objj_msgSend(_13b,"addObserver:selector:name:object:",_delegate,sel_getUid("tableViewSelectionDidChange:"),CPTableViewSelectionDidChangeNotification,self);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableViewSelectionIsChanging:"))){
objj_msgSend(_13b,"addObserver:selector:name:object:",_delegate,sel_getUid("tableViewSelectionIsChanging:"),CPTableViewSelectionIsChangingNotification,self);
}
}
}),new objj_method(sel_getUid("delegate"),function(self,_13c){
with(self){
return _delegate;
}
}),new objj_method(sel_getUid("_sendDelegateDidClickColumn:"),function(self,_13d,_13e){
with(self){
if(_implementedDelegateMethods&_9){
objj_msgSend(_delegate,"tableView:didClickTableColumn:",self,_tableColumns[_13e]);
}
}
}),new objj_method(sel_getUid("_sendDelegateDidDragColumn:"),function(self,_13f,_140){
with(self){
if(_implementedDelegateMethods&_a){
objj_msgSend(_delegate,"tableView:didDragTableColumn:",self,_tableColumns[_140]);
}
}
}),new objj_method(sel_getUid("_sendDelegateDidMouseDownInHeader:"),function(self,_141,_142){
with(self){
if(_implementedDelegateMethods&_d){
objj_msgSend(_delegate,"tableView:mouseDownInHeaderOfTableColumn:",self,_tableColumns[_142]);
}
}
}),new objj_method(sel_getUid("_sendDataSourceSortDescriptorsDidChange:"),function(self,_143,_144){
with(self){
if(_implementedDataSourceMethods&_6){
objj_msgSend(_dataSource,"tableView:sortDescriptorsDidChange:",self,_144);
}
}
}),new objj_method(sel_getUid("_didClickTableColumn:modifierFlags:"),function(self,_145,_146,_147){
with(self){
objj_msgSend(self,"_sendDelegateDidClickColumn:",_146);
if(_allowsColumnSelection){
if(_147&CPCommandKeyMask){
if(objj_msgSend(self,"isColumnSelected:",_146)){
objj_msgSend(self,"deselectColumn:",_146);
}else{
if(objj_msgSend(self,"allowsMultipleSelection")==YES){
objj_msgSend(self,"selectColumnIndexes:byExtendingSelection:",objj_msgSend(CPIndexSet,"indexSetWithIndex:",_146),YES);
}
}
return;
}else{
if(_147&CPShiftKeyMask){
var _148=MIN(_146,objj_msgSend(_selectedColumnIndexes,"lastIndex")),_149=MAX(_146,objj_msgSend(_selectedColumnIndexes,"firstIndex"));
objj_msgSend(self,"selectColumnIndexes:byExtendingSelection:",objj_msgSend(CPIndexSet,"indexSetWithIndexesInRange:",CPMakeRange(_148,_149-_148+1)),YES);
return;
}else{
objj_msgSend(self,"selectColumnIndexes:byExtendingSelection:",objj_msgSend(CPIndexSet,"indexSetWithIndex:",_146),NO);
}
}
}
objj_msgSend(self,"_changeSortDescriptorsForClickOnColumn:",_146);
}
}),new objj_method(sel_getUid("_changeSortDescriptorsForClickOnColumn:"),function(self,_14a,_14b){
with(self){
var _14c=objj_msgSend(_tableColumns,"objectAtIndex:",_14b),_14d=objj_msgSend(_14c,"sortDescriptorPrototype");
if(!_14d){
return;
}
var _14e=nil,_14f=objj_msgSend(self,"sortDescriptors"),_150=objj_msgSend(CPArray,"arrayWithArray:",_14f),e=objj_msgSend(_150,"objectEnumerator"),_151=nil,_152=objj_msgSend(CPArray,"array");
if(objj_msgSend(_sortDescriptors,"count")>0){
_14e=objj_msgSend(objj_msgSend(self,"sortDescriptors"),"objectAtIndex:",0);
}
while((_151=objj_msgSend(e,"nextObject"))!=nil){
if(objj_msgSend(objj_msgSend(_151,"key"),"isEqual:",objj_msgSend(_14d,"key"))){
objj_msgSend(_152,"addObject:",_151);
}
}
if(objj_msgSend(objj_msgSend(_14d,"key"),"isEqual:",objj_msgSend(_14e,"key"))){
_14d=objj_msgSend(_14e,"reversedSortDescriptor");
}
objj_msgSend(_150,"removeObjectsInArray:",_152);
objj_msgSend(_150,"insertObject:atIndex:",_14d,0);
var _153=objj_msgSend(_14d,"ascending")?objj_msgSend(CPTableView,"_defaultTableHeaderSortImage"):objj_msgSend(CPTableView,"_defaultTableHeaderReverseSortImage");
objj_msgSend(self,"setIndicatorImage:inTableColumn:",nil,_currentHighlightedTableColumn);
objj_msgSend(self,"setIndicatorImage:inTableColumn:",_153,_14c);
objj_msgSend(self,"setHighlightedTableColumn:",_14c);
objj_msgSend(self,"setSortDescriptors:",_150);
}
}),new objj_method(sel_getUid("setIndicatorImage:inTableColumn:"),function(self,_154,_155,_156){
with(self){
if(_156){
objj_msgSend(objj_msgSend(_156,"headerView"),"_setIndicatorImage:",_155);
}
}
}),new objj_method(sel_getUid("highlightedTableColumn"),function(self,_157){
with(self){
return _currentHighlightedTableColumn;
}
}),new objj_method(sel_getUid("setHighlightedTableColumn:"),function(self,_158,_159){
with(self){
if(_currentHighlightedTableColumn==_159){
return;
}
if(_headerView){
if(_currentHighlightedTableColumn!=nil){
objj_msgSend(objj_msgSend(_currentHighlightedTableColumn,"headerView"),"unsetThemeState:",CPThemeStateSelected);
}
if(_159!=nil){
objj_msgSend(objj_msgSend(_159,"headerView"),"setThemeState:",CPThemeStateSelected);
}
}
_currentHighlightedTableColumn=_159;
}
}),new objj_method(sel_getUid("canDragRowsWithIndexes:atPoint:"),function(self,_15a,_15b,_15c){
with(self){
return YES;
}
}),new objj_method(sel_getUid("dragImageForRowsWithIndexes:tableColumns:event:offset:"),function(self,_15d,_15e,_15f,_160,_161){
with(self){
return objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:","Frameworks/AppKit/Resources/GenericFile.png",CGSizeMake(32,32));
}
}),new objj_method(sel_getUid("dragViewForRowsWithIndexes:tableColumns:event:offset:"),function(self,_162,_163,_164,_165,_166){
with(self){
var _167=objj_msgSend(self,"bounds"),view=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",_167);
objj_msgSend(view,"setAlphaValue:",0.7);
var _168=objj_msgSend(_exposedColumns,"firstIndex"),_169=objj_msgSend(_exposedRows,"firstIndex"),_16a=objj_msgSend(_exposedColumns,"lastIndex")-_168+1,_16b=objj_msgSend(_exposedRows,"lastIndex")-_169+1,_16c=[],rows=[];
objj_msgSend(_exposedColumns,"getIndexes:maxCount:inIndexRange:",_16c,-1,CPMakeRange(_168,_16a));
objj_msgSend(_163,"getIndexes:maxCount:inIndexRange:",rows,-1,CPMakeRange(_169,_16b));
var _16d=objj_msgSend(_16c,"count");
while(_16d--){
var _16e=_16c[_16d],_16f=objj_msgSend(_tableColumns,"objectAtIndex:",_16e),_170=objj_msgSend(rows,"count");
while(_170--){
var row=rows[_170];
var _171=objj_msgSend(self,"_newDataViewForRow:tableColumn:",row,_16f);
objj_msgSend(_171,"setFrame:",objj_msgSend(self,"frameOfDataViewAtColumn:row:",_16e,row));
objj_msgSend(_171,"setObjectValue:",objj_msgSend(self,"_objectValueForTableColumn:row:",_16f,row));
objj_msgSend(view,"addSubview:",_171);
}
}
var _172=objj_msgSend(self,"convertPoint:fromView:",objj_msgSend(_165,"locationInWindow"),nil);
_166.x=CGRectGetWidth(_167)/2-_172.x;
_166.y=CGRectGetHeight(_167)/2-_172.y;
return view;
}
}),new objj_method(sel_getUid("setDraggingSourceOperationMask:forLocal:"),function(self,_173,mask,_174){
with(self){
_dragOperationDefaultMask=mask;
}
}),new objj_method(sel_getUid("setDropRow:dropOperation:"),function(self,_175,row,_176){
with(self){
if(row>objj_msgSend(self,"numberOfRows")&&_176===CPTableViewDropOn){
var _177=objj_msgSend(self,"numberOfRows")+1;
var _178="Attempt to set dropRow="+row+" dropOperation=CPTableViewDropOn when [0 - "+_177+"] is valid range of rows.";
objj_msgSend(objj_msgSend(CPException,"exceptionWithName:reason:userInfo:","Error",_178,nil),"raise");
}
_retargetedDropRow=row;
_retargetedDropOperation=_176;
}
}),new objj_method(sel_getUid("setDraggingDestinationFeedbackStyle:"),function(self,_179,_17a){
with(self){
_destinationDragStyle=_17a;
}
}),new objj_method(sel_getUid("draggingDestinationFeedbackStyle"),function(self,_17b){
with(self){
return _destinationDragStyle;
}
}),new objj_method(sel_getUid("setVerticalMotionCanBeginDrag:"),function(self,_17c,_17d){
with(self){
_verticalMotionCanDrag=_17d;
}
}),new objj_method(sel_getUid("verticalMotionCanBeginDrag"),function(self,_17e){
with(self){
return _verticalMotionCanDrag;
}
}),new objj_method(sel_getUid("setSortDescriptors:"),function(self,_17f,_180){
with(self){
var _181=objj_msgSend(self,"sortDescriptors"),_182=nil;
if(_180==nil){
_182=objj_msgSend(CPArray,"array");
}else{
_182=objj_msgSend(CPArray,"arrayWithArray:",_180);
}
if(objj_msgSend(_182,"isEqual:",_181)){
return;
}
_sortDescriptors=_182;
objj_msgSend(self,"_sendDataSourceSortDescriptorsDidChange:",_181);
}
}),new objj_method(sel_getUid("sortDescriptors"),function(self,_183){
with(self){
return _sortDescriptors;
}
}),new objj_method(sel_getUid("_objectValueForTableColumn:row:"),function(self,_184,_185,_186){
with(self){
var _187=objj_msgSend(_185,"UID"),_188=_objectValues[_187];
if(!_188){
_188=[];
_objectValues[_187]=_188;
}
var _189=_188[_186];
if(_189===undefined){
_189=objj_msgSend(_dataSource,"tableView:objectValueForTableColumn:row:",self,_185,_186);
_188[_186]=_189;
}
return _189;
}
}),new objj_method(sel_getUid("_exposedRect"),function(self,_18a){
with(self){
var _18b=objj_msgSend(self,"superview");
if(!objj_msgSend(_18b,"isKindOfClass:",objj_msgSend(CPClipView,"class"))){
return objj_msgSend(self,"bounds");
}
return objj_msgSend(self,"convertRect:fromView:",CGRectIntersection(objj_msgSend(_18b,"bounds"),objj_msgSend(self,"frame")),_18b);
}
}),new objj_method(sel_getUid("load"),function(self,_18c){
with(self){
if(_reloadAllRows){
objj_msgSend(self,"_unloadDataViewsInRows:columns:",_exposedRows,_exposedColumns);
_exposedRows=objj_msgSend(CPIndexSet,"indexSet");
_exposedColumns=objj_msgSend(CPIndexSet,"indexSet");
_reloadAllRows=NO;
}
var _18d=objj_msgSend(self,"_exposedRect"),_18e=objj_msgSend(CPIndexSet,"indexSetWithIndexesInRange:",objj_msgSend(self,"rowsInRect:",_18d)),_18f=objj_msgSend(self,"columnIndexesInRect:",_18d),_190=objj_msgSend(_exposedRows,"copy"),_191=objj_msgSend(_exposedColumns,"copy");
objj_msgSend(_190,"removeIndexes:",_18e);
objj_msgSend(_191,"removeIndexes:",_18f);
var _192=objj_msgSend(_18e,"copy"),_193=objj_msgSend(_18f,"copy");
objj_msgSend(_192,"removeIndexes:",_exposedRows);
objj_msgSend(_193,"removeIndexes:",_exposedColumns);
var _194=objj_msgSend(_18e,"copy"),_195=objj_msgSend(_18f,"copy");
objj_msgSend(_194,"removeIndexes:",_192);
objj_msgSend(_195,"removeIndexes:",_193);
objj_msgSend(self,"_unloadDataViewsInRows:columns:",_194,_191);
objj_msgSend(self,"_unloadDataViewsInRows:columns:",_190,_195);
objj_msgSend(self,"_unloadDataViewsInRows:columns:",_190,_191);
objj_msgSend(self,"_loadDataViewsInRows:columns:",_194,_193);
objj_msgSend(self,"_loadDataViewsInRows:columns:",_192,_195);
objj_msgSend(self,"_loadDataViewsInRows:columns:",_192,_193);
_exposedRows=_18e;
_exposedColumns=_18f;
objj_msgSend(_tableDrawView,"setFrame:",_18d);
objj_msgSend(_tableDrawView,"display");
for(var _196 in _cachedDataViews){
var _197=_cachedDataViews[_196],_198=_197.length;
while(_198--){
objj_msgSend(_197[_198],"removeFromSuperview");
}
}
}
}),new objj_method(sel_getUid("_unloadDataViewsInRows:columns:"),function(self,_199,rows,_19a){
with(self){
if(!objj_msgSend(rows,"count")||!objj_msgSend(_19a,"count")){
return;
}
var _19b=[],_19c=[];
objj_msgSend(rows,"getIndexes:maxCount:inIndexRange:",_19b,-1,nil);
objj_msgSend(_19a,"getIndexes:maxCount:inIndexRange:",_19c,-1,nil);
var _19d=0,_19e=_19c.length;
for(;_19d<_19e;++_19d){
var _19f=_19c[_19d],_1a0=_tableColumns[_19f],_1a1=objj_msgSend(_1a0,"UID");
var _1a2=0,_1a3=_19b.length;
for(;_1a2<_1a3;++_1a2){
var row=_19b[_1a2],_1a4=_dataViewsForTableColumns[_1a1][row];
_dataViewsForTableColumns[_1a1][row]=nil;
objj_msgSend(self,"_enqueueReusableDataView:",_1a4);
}
}
}
}),new objj_method(sel_getUid("_loadDataViewsInRows:columns:"),function(self,_1a5,rows,_1a6){
with(self){
if(!objj_msgSend(rows,"count")||!objj_msgSend(_1a6,"count")){
return;
}
var _1a7=[],_1a8=[],_1a9=[];
objj_msgSend(rows,"getIndexes:maxCount:inIndexRange:",_1a7,-1,nil);
objj_msgSend(_1a6,"getIndexes:maxCount:inIndexRange:",_1a9,-1,nil);
if(_dirtyTableColumnRangeIndex!==CPNotFound){
objj_msgSend(self,"_recalculateTableColumnRanges");
}
var _1aa=0,_1ab=_1a9.length;
for(;_1aa<_1ab;++_1aa){
var _1ac=_1a9[_1aa],_1ad=_tableColumns[_1ac],_1ae=objj_msgSend(_1ad,"UID");
if(!_dataViewsForTableColumns[_1ae]){
_dataViewsForTableColumns[_1ae]=[];
}
var _1af=0,_1b0=_1a7.length;
var _1b1=objj_msgSend(_selectedColumnIndexes,"containsIndex:",_1ac);
for(;_1af<_1b0;++_1af){
var row=_1a7[_1af],_1b2=objj_msgSend(self,"_newDataViewForRow:tableColumn:",row,_1ad),_1b3=objj_msgSend(_1b2,"isKindOfClass:",objj_msgSend(CPButton,"class")),_1b4=objj_msgSend(_1b2,"isKindOfClass:",objj_msgSend(CPTextField,"class"));
objj_msgSend(_1b2,"setFrame:",objj_msgSend(self,"frameOfDataViewAtColumn:row:",_1ac,row));
objj_msgSend(_1b2,"setObjectValue:",objj_msgSend(self,"_objectValueForTableColumn:row:",_1ad,row));
if(_1b1||objj_msgSend(self,"isRowSelected:",row)){
objj_msgSend(_1b2,"setThemeState:",CPThemeStateSelected);
}else{
objj_msgSend(_1b2,"unsetThemeState:",CPThemeStateSelected);
}
if(_implementedDelegateMethods&_18){
objj_msgSend(_delegate,"tableView:willDisplayView:forTableColumn:row:",self,_1b2,_1ad,row);
}
if(objj_msgSend(_1b2,"superview")!==self){
objj_msgSend(self,"addSubview:",_1b2);
}
_dataViewsForTableColumns[_1ae][row]=_1b2;
if(_1b3||(_editingCellIndex&&_editingCellIndex.x===_1ac&&_editingCellIndex.y===row)){
if(!_1b3){
_editingCellIndex=undefined;
}
if(_1b4){
objj_msgSend(_1b2,"setEditable:",YES);
objj_msgSend(_1b2,"setSendsActionOnEndEditing:",YES);
objj_msgSend(_1b2,"setSelectable:",YES);
objj_msgSend(_1b2,"selectText:",nil);
}
objj_msgSend(_1b2,"setTarget:",self);
objj_msgSend(_1b2,"setAction:",sel_getUid("_commitDataViewObjectValue:"));
_1b2.tableViewEditedColumnObj=_1ad;
_1b2.tableViewEditedRowIndex=row;
}else{
if(_1b4){
objj_msgSend(_1b2,"setEditable:",NO);
objj_msgSend(_1b2,"setSelectable:",NO);
}
}
}
}
}
}),new objj_method(sel_getUid("_layoutDataViewsInRows:columns:"),function(self,_1b5,rows,_1b6){
with(self){
var _1b7=[],_1b8=[];
objj_msgSend(rows,"getIndexes:maxCount:inIndexRange:",_1b7,-1,nil);
objj_msgSend(_1b6,"getIndexes:maxCount:inIndexRange:",_1b8,-1,nil);
var _1b9=0,_1ba=_1b8.length;
for(;_1b9<_1ba;++_1b9){
var _1bb=_1b8[_1b9],_1bc=_tableColumns[_1bb],_1bd=objj_msgSend(_1bc,"UID"),_1be=_dataViewsForTableColumns[_1bd],_1bf=_tableColumnRanges[_1bb];
var _1c0=0,_1c1=_1b7.length;
for(;_1c0<_1c1;++_1c0){
var row=_1b7[_1c0],_1c2=_1be[row];
objj_msgSend(_1c2,"setFrame:",objj_msgSend(self,"frameOfDataViewAtColumn:row:",_1bb,row));
}
}
}
}),new objj_method(sel_getUid("_commitDataViewObjectValue:"),function(self,_1c3,_1c4){
with(self){
objj_msgSend(_dataSource,"tableView:setObjectValue:forTableColumn:row:",self,objj_msgSend(_1c4,"objectValue"),_1c4.tableViewEditedColumnObj,_1c4.tableViewEditedRowIndex);
if(objj_msgSend(_1c4,"respondsToSelector:",sel_getUid("setEditable:"))){
objj_msgSend(_1c4,"setEditable:",NO);
}
}
}),new objj_method(sel_getUid("_newDataViewForRow:tableColumn:"),function(self,_1c5,aRow,_1c6){
with(self){
if((_implementedDelegateMethods&_8)){
var _1c7=objj_msgSend(_delegate,"tableView:dataViewForTableColumn:row:",self,_1c6,aRow);
objj_msgSend(_1c6,"setDataView:",_1c7);
}
return objj_msgSend(_1c6,"_newDataViewForRow:",aRow);
}
}),new objj_method(sel_getUid("_enqueueReusableDataView:"),function(self,_1c8,_1c9){
with(self){
var _1ca=_1c9.identifier;
if(!_cachedDataViews[_1ca]){
_cachedDataViews[_1ca]=[_1c9];
}else{
_cachedDataViews[_1ca].push(_1c9);
}
}
}),new objj_method(sel_getUid("setFrameSize:"),function(self,_1cb,_1cc){
with(self){
objj_msgSendSuper({receiver:self,super_class:objj_getClass("CPTableView").super_class},"setFrameSize:",_1cc);
if(_headerView){
objj_msgSend(_headerView,"setFrameSize:",{width:(objj_msgSend(self,"frame").size.width),height:(objj_msgSend(_headerView,"frame").size.height)});
}
}
}),new objj_method(sel_getUid("exposedClipRect"),function(self,_1cd){
with(self){
var _1ce=objj_msgSend(self,"superview");
if(!objj_msgSend(_1ce,"isKindOfClass:",objj_msgSend(CPClipView,"class"))){
return objj_msgSend(self,"bounds");
}
return objj_msgSend(self,"convertRect:fromView:",CGRectIntersection(objj_msgSend(_1ce,"bounds"),objj_msgSend(self,"frame")),_1ce);
}
}),new objj_method(sel_getUid("_drawRect:"),function(self,_1cf,_1d0){
with(self){
var _1d1=objj_msgSend(self,"_exposedRect");
objj_msgSend(self,"drawBackgroundInClipRect:",_1d1);
objj_msgSend(self,"drawGridInClipRect:",_1d1);
objj_msgSend(self,"highlightSelectionInClipRect:",_1d1);
}
}),new objj_method(sel_getUid("drawBackgroundInClipRect:"),function(self,_1d2,_1d3){
with(self){
if(!_usesAlternatingRowBackgroundColors){
var _1d4=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort");
CGContextSetFillColor(_1d4,_backgroundColor);
CGContextFillRect(_1d4,_1d3);
return;
}
var _1d5=objj_msgSend(self,"alternatingRowBackgroundColors"),_1d6=objj_msgSend(_1d5,"count");
if(_1d6===0){
return;
}
var _1d4=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort");
if(_1d6===1){
CGContextSetFillColor(_1d4,_1d5[0]);
CGContextFillRect(_1d4,_1d3);
return;
}
var _1d7=objj_msgSend(self,"rowsInRect:",_1d3),_1d8=_1d7.location,_1d9=CPMaxRange(_1d7)-1,_1da=MIN(_1d7.length,_1d6),_1db=0;
while(_1da--){
var row=_1d8-_1d8%_1d6+_1da,_1dc=nil;
CGContextBeginPath(_1d4);
for(;row<=_1d9;row+=_1d6){
if(row>=_1d8){
CGContextAddRect(_1d4,CGRectIntersection(_1d3,_1dc=objj_msgSend(self,"rectOfRow:",row)));
}
}
if(row-_1d6===_1d9){
_1db=(_1dc.origin.y+_1dc.size.height);
}
CGContextClosePath(_1d4);
CGContextSetFillColor(_1d4,_1d5[_1da]);
CGContextFillPath(_1d4);
}
var _1dd=(_1d3.origin.y+_1d3.size.height);
if(_1db>=_1dd||_rowHeight<=0){
return;
}
var _1de=_rowHeight+_intercellSpacing.height,_1dc={origin:{x:(_1d3.origin.x),y:(_1d3.origin.y)+_1db},size:{width:(_1d3.size.width),height:_1de}};
for(row=_1d9+1;_1db<_1dd;++row){
CGContextSetFillColor(_1d4,_1d5[row%_1d6]);
CGContextFillRect(_1d4,_1dc);
_1db+=_1de;
_1dc.origin.y+=_1de;
}
}
}),new objj_method(sel_getUid("drawGridInClipRect:"),function(self,_1df,_1e0){
with(self){
var _1e1=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort"),_1e2=objj_msgSend(self,"gridStyleMask");
if(!(_1e2&(CPTableViewSolidHorizontalGridLineMask|CPTableViewSolidVerticalGridLineMask))){
return;
}
CGContextBeginPath(_1e1);
if(_1e2&CPTableViewSolidHorizontalGridLineMask){
var _1e3=objj_msgSend(self,"rowsInRect:",_1e0);
row=_1e3.location,lastRow=CPMaxRange(_1e3)-1,rowY=0,minX=(_1e0.origin.x),maxX=(_1e0.origin.x+_1e0.size.width);
for(;row<=lastRow;++row){
var _1e4=objj_msgSend(self,"rectOfRow:",row),rowY=(_1e4.origin.y+_1e4.size.height)-0.5;
CGContextMoveToPoint(_1e1,minX,rowY);
CGContextAddLineToPoint(_1e1,maxX,rowY);
}
if(_rowHeight>0){
var _1e5=_rowHeight+_intercellSpacing.height,_1e6=(_1e0.origin.y+_1e0.size.height);
while(rowY<_1e6){
rowY+=_1e5;
CGContextMoveToPoint(_1e1,minX,rowY);
CGContextAddLineToPoint(_1e1,maxX,rowY);
}
}
}
if(_1e2&CPTableViewSolidVerticalGridLineMask){
var _1e7=objj_msgSend(self,"columnIndexesInRect:",_1e0),_1e8=[];
objj_msgSend(_1e7,"getIndexes:maxCount:inIndexRange:",_1e8,-1,nil);
var _1e9=0,_1ea=_1e8.length,minY=(_1e0.origin.y),maxY=(_1e0.origin.y+_1e0.size.height);
for(;_1e9<_1ea;++_1e9){
var _1eb=objj_msgSend(self,"rectOfColumn:",_1e8[_1e9]),_1ec=(_1eb.origin.x+_1eb.size.width)+0.5;
CGContextMoveToPoint(_1e1,_1ec,minY);
CGContextAddLineToPoint(_1e1,_1ec,maxY);
}
}
CGContextClosePath(_1e1);
CGContextSetStrokeColor(_1e1,_gridColor);
CGContextStrokePath(_1e1);
}
}),new objj_method(sel_getUid("highlightSelectionInClipRect:"),function(self,_1ed,_1ee){
with(self){
var _1ef=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort"),_1f0=[],_1f1=sel_getUid("rectOfRow:");
if(objj_msgSend(_selectedRowIndexes,"count")>=1){
var _1f2=objj_msgSend(CPIndexSet,"indexSetWithIndexesInRange:",objj_msgSend(self,"rowsInRect:",_1ee)),_1f3=objj_msgSend(_1f2,"firstIndex"),_1f4=CPMakeRange(_1f3,objj_msgSend(_1f2,"lastIndex")-_1f3+1);
objj_msgSend(_selectedRowIndexes,"getIndexes:maxCount:inIndexRange:",_1f0,-1,_1f4);
}else{
if(objj_msgSend(_selectedColumnIndexes,"count")>=1){
_1f1=sel_getUid("rectOfColumn:");
var _1f5=objj_msgSend(self,"columnIndexesInRect:",_1ee),_1f6=objj_msgSend(_1f5,"firstIndex"),_1f4=CPMakeRange(_1f6,objj_msgSend(_1f5,"lastIndex")-_1f6+1);
objj_msgSend(_selectedColumnIndexes,"getIndexes:maxCount:inIndexRange:",_1f0,-1,_1f4);
}
}
var _1f7=count2=objj_msgSend(_1f0,"count");
if(!_1f7){
return;
}
var _1f8=(_selectionHighlightStyle===CPTableViewSelectionHighlightStyleSourceList&&objj_msgSend(_selectedRowIndexes,"count")>=1);
var _1f9=0.5*(_gridStyleMask&CPTableViewSolidHorizontalGridLineMask);
CGContextBeginPath(_1ef);
while(_1f7--){
var _1fa=CGRectIntersection(objj_msgSend(self,_1f1,_1f0[_1f7]),_1ee);
CGContextAddRect(_1ef,_1fa);
if(_1f8){
var minX=(_1fa.origin.x),minY=(_1fa.origin.y),maxX=(_1fa.origin.x+_1fa.size.width),maxY=(_1fa.origin.y+_1fa.size.height)-_1f9;
CGContextDrawLinearGradient(_1ef,_sourceListActiveGradient,_1fa.origin,CGPointMake(minX,maxY),0);
CGContextClosePath(_1ef);
CGContextBeginPath(_1ef);
CGContextMoveToPoint(_1ef,minX,minY);
CGContextAddLineToPoint(_1ef,maxX,minY);
CGContextClosePath(_1ef);
CGContextSetStrokeColor(_1ef,_sourceListActiveTopLineColor);
CGContextStrokePath(_1ef);
CGContextBeginPath(_1ef);
CGContextMoveToPoint(_1ef,minX,maxY);
CGContextAddLineToPoint(_1ef,maxX,maxY-1);
CGContextClosePath(_1ef);
CGContextSetStrokeColor(_1ef,_sourceListActiveBottomLineColor);
CGContextStrokePath(_1ef);
}
}
CGContextClosePath(_1ef);
if(!_1f8){
objj_msgSend(objj_msgSend(CPColor,"selectionColor"),"setFill");
CGContextFillPath(_1ef);
}
CGContextBeginPath(_1ef);
gridStyleMask=objj_msgSend(self,"gridStyleMask");
for(var i=0;i<count2;i++){
var rect=objj_msgSend(self,_1f1,_1f0[i]),minX=CGRectGetMinX(rect)-0.5,maxX=CGRectGetMaxX(rect)-0.5,minY=CGRectGetMinY(rect)-0.5,maxY=CGRectGetMaxY(rect)-0.5;
if(objj_msgSend(_selectedRowIndexes,"count")>=1&&gridStyleMask&CPTableViewSolidVerticalGridLineMask){
var _1f5=objj_msgSend(self,"columnIndexesInRect:",_1ee),_1fb=[],_1fc=objj_msgSend(_1f5,"firstIndex"),_1f4=CPMakeRange(_1fc,objj_msgSend(_1f5,"lastIndex")-_1fc+1);
objj_msgSend(_1f5,"getIndexes:maxCount:inIndexRange:",_1fb,-1,_1f4);
var _1fd=objj_msgSend(_1fb,"count");
for(var c=_1fc;c<_1fd;c++){
var _1fe=objj_msgSend(self,"rectOfColumn:",_1fb[c]),colX=CGRectGetMaxX(_1fe)+0.5;
CGContextMoveToPoint(_1ef,colX,minY);
CGContextAddLineToPoint(_1ef,colX,maxY);
}
}
if(objj_msgSend(_1f0,"containsObject:",_1f0[i]+1)){
CGContextMoveToPoint(_1ef,minX,maxY);
CGContextAddLineToPoint(_1ef,maxX,maxY);
}
}
CGContextClosePath(_1ef);
CGContextSetStrokeColor(_1ef,objj_msgSend(CPColor,"colorWithHexString:","e5e5e5"));
CGContextStrokePath(_1ef);
}
}),new objj_method(sel_getUid("layoutSubviews"),function(self,_1ff){
with(self){
objj_msgSend(self,"load");
}
}),new objj_method(sel_getUid("viewWillMoveToSuperview:"),function(self,_200,_201){
with(self){
var _202=objj_msgSend(self,"superview"),_203=objj_msgSend(CPNotificationCenter,"defaultCenter");
if(_202){
objj_msgSend(_203,"removeObserver:name:object:",self,CPViewFrameDidChangeNotification,_202);
objj_msgSend(_203,"removeObserver:name:object:",self,CPViewBoundsDidChangeNotification,_202);
}
if(_201){
objj_msgSend(_201,"setPostsFrameChangedNotifications:",YES);
objj_msgSend(_201,"setPostsBoundsChangedNotifications:",YES);
objj_msgSend(_203,"addObserver:selector:name:object:",self,sel_getUid("superviewFrameChanged:"),CPViewFrameDidChangeNotification,_201);
objj_msgSend(_203,"addObserver:selector:name:object:",self,sel_getUid("superviewBoundsChanged:"),CPViewBoundsDidChangeNotification,_201);
}
}
}),new objj_method(sel_getUid("superviewBoundsChanged:"),function(self,_204,_205){
with(self){
objj_msgSend(self,"setNeedsDisplay:",YES);
objj_msgSend(self,"setNeedsLayout");
}
}),new objj_method(sel_getUid("superviewFrameChanged:"),function(self,_206,_207){
with(self){
objj_msgSend(self,"tile");
}
}),new objj_method(sel_getUid("tracksMouseOutsideOfFrame"),function(self,_208){
with(self){
return YES;
}
}),new objj_method(sel_getUid("startTrackingAt:"),function(self,_209,_20a){
with(self){
var row=objj_msgSend(self,"rowAtPoint:",_20a);
if(row<0&&_allowsEmptySelection){
objj_msgSend(self,"selectRowIndexes:byExtendingSelection:",objj_msgSend(CPIndexSet,"indexSet"),NO);
}
objj_msgSend(self,"_noteSelectionIsChanging");
if(objj_msgSend(self,"mouseDownFlags")&CPShiftKeyMask){
_selectionAnchorRow=(ABS(objj_msgSend(_selectedRowIndexes,"firstIndex")-row)<ABS(objj_msgSend(_selectedRowIndexes,"lastIndex")-row))?objj_msgSend(_selectedRowIndexes,"firstIndex"):objj_msgSend(_selectedRowIndexes,"lastIndex");
}else{
_selectionAnchorRow=row;
}
_startTrackingPoint=_20a;
_startTrackingTimestamp=new Date();
if(_implementedDataSourceMethods&_1){
_trackingPointMovedOutOfClickSlop=NO;
}
if(row>=0&&!(_implementedDataSourceMethods&_5)){
objj_msgSend(self,"_updateSelectionWithMouseAtRow:",row);
}
objj_msgSend(objj_msgSend(self,"window"),"makeFirstResponder:",self);
return YES;
}
}),new objj_method(sel_getUid("trackMouse:"),function(self,_20b,_20c){
with(self){
if(!objj_msgSend(_draggedRowIndexes,"count")){
objj_msgSendSuper({receiver:self,super_class:objj_getClass("CPTableView").super_class},"trackMouse:",_20c);
}else{
objj_msgSend(CPApp,"sendEvent:",_20c);
}
}
}),new objj_method(sel_getUid("continueTracking:at:"),function(self,_20d,_20e,_20f){
with(self){
var row=objj_msgSend(self,"rowAtPoint:",_20f);
if(!_isSelectingSession&&_implementedDataSourceMethods&_5){
if(row>=0&&(ABS(_startTrackingPoint.x-_20f.x)>3||(_verticalMotionCanDrag&&ABS(_startTrackingPoint.y-_20f.y)>3))||(objj_msgSend(_selectedRowIndexes,"containsIndex:",row))){
if(objj_msgSend(_selectedRowIndexes,"containsIndex:",row)){
_draggedRowIndexes=objj_msgSend(objj_msgSend(CPIndexSet,"alloc"),"initWithIndexSet:",_selectedRowIndexes);
}else{
_draggedRowIndexes=objj_msgSend(CPIndexSet,"indexSetWithIndex:",row);
}
var _210=objj_msgSend(CPPasteboard,"pasteboardWithName:",CPDragPboard);
if(objj_msgSend(self,"canDragRowsWithIndexes:atPoint:",_draggedRowIndexes,_20f)&&objj_msgSend(_dataSource,"tableView:writeRowsWithIndexes:toPasteboard:",self,_draggedRowIndexes,_210)){
var _211=objj_msgSend(CPApp,"currentEvent"),_212=CPPointMakeZero(),_213=objj_msgSend(_tableColumns,"objectsAtIndexes:",_exposedColumns);
var view=objj_msgSend(self,"dragViewForRowsWithIndexes:tableColumns:event:offset:",_draggedRowIndexes,_213,_211,_212);
if(!view){
var _214=objj_msgSend(self,"dragImageForRowsWithIndexes:tableColumns:event:offset:",_draggedRowIndexes,_213,_211,_212);
view=objj_msgSend(objj_msgSend(CPImageView,"alloc"),"initWithFrame:",CPMakeRect(0,0,objj_msgSend(_214,"size").width,objj_msgSend(_214,"size").height));
objj_msgSend(view,"setImage:",_214);
}
var _215=objj_msgSend(view,"bounds");
var _216=CPPointMake(_20f.x-CGRectGetWidth(_215)/2+_212.x,_20f.y-CGRectGetHeight(_215)/2+_212.y);
objj_msgSend(self,"dragView:at:offset:event:pasteboard:source:slideBack:",view,_216,CPPointMakeZero(),objj_msgSend(CPApp,"currentEvent"),_210,self,YES);
_startTrackingPoint=nil;
return NO;
}
_draggedRowIndexes=objj_msgSend(CPIndexSet,"indexSet");
}else{
if(ABS(_startTrackingPoint.x-_20f.x)<5&&ABS(_startTrackingPoint.y-_20f.y)<5){
return YES;
}
}
}
_isSelectingSession=YES;
if(row>=0){
objj_msgSend(self,"_updateSelectionWithMouseAtRow:",row);
}
if((_implementedDataSourceMethods&_1)&&!_trackingPointMovedOutOfClickSlop){
var _217=5;
if(ABS(_20f.x-_startTrackingPoint.x)>_217||ABS(_20f.y-_startTrackingPoint.y)>_217){
_trackingPointMovedOutOfClickSlop=YES;
}
}
return YES;
}
}),new objj_method(sel_getUid("stopTracking:at:mouseIsUp:"),function(self,_218,_219,_21a,_21b){
with(self){
_isSelectingSession=NO;
var _21c=1000,_21d,_21e,_21f,_220=YES;
if(_implementedDataSourceMethods&_5){
_21f=objj_msgSend(self,"rowAtPoint:",_21a);
if(_21f!==-1){
if(objj_msgSend(_draggedRowIndexes,"count")>0){
_draggedRowIndexes=objj_msgSend(CPIndexSet,"indexSet");
return;
}
_previouslySelectedRowIndexes=objj_msgSend(_selectedRowIndexes,"copy");
objj_msgSend(self,"_updateSelectionWithMouseAtRow:",_21f);
}
}
if(_21b&&(_implementedDataSourceMethods&_1)&&!_trackingPointMovedOutOfClickSlop&&(objj_msgSend(objj_msgSend(CPApp,"currentEvent"),"clickCount")>1)){
_21d=objj_msgSend(self,"columnAtPoint:",_219);
if(_21d!==-1){
_21e=_tableColumns[_21d];
if(objj_msgSend(_21e,"isEditable")){
_21f=objj_msgSend(self,"rowAtPoint:",_21a);
if(_21f!==-1){
if(_implementedDelegateMethods&_10){
_220=objj_msgSend(_delegate,"tableView:shouldEditTableColumn:row:",self,_21e,_21f);
}
if(_220){
_editingCellIndex=CGPointMake(_21d,_21f);
objj_msgSend(self,"reloadDataForRowIndexes:columnIndexes:",objj_msgSend(CPIndexSet,"indexSetWithIndex:",_21f),objj_msgSend(CPIndexSet,"indexSetWithIndex:",_21d));
return;
}
}
}
}
}
if(objj_msgSend(objj_msgSend(CPApp,"currentEvent"),"clickCount")===2&&_doubleAction&&_target){
objj_msgSend(self,"sendAction:to:",_doubleAction,_target);
}
}
}),new objj_method(sel_getUid("draggingEntered:"),function(self,_221,_222){
with(self){
var _223=objj_msgSend(self,"convertPoint:fromView:",objj_msgSend(_222,"draggingLocation"),nil),_224=objj_msgSend(self,"_proposedDropOperationAtPoint:",_223),row=objj_msgSend(self,"_proposedRowAtPoint:",_223);
if(_retargetedDropRow!==nil){
row=_retargetedDropRow;
}
var _225=objj_msgSend(self,"registeredDraggedTypes"),_226=objj_msgSend(_225,"count"),i=0;
for(;i<_226;i++){
if(objj_msgSend(objj_msgSend(objj_msgSend(_222,"draggingPasteboard"),"types"),"containsObject:",objj_msgSend(_225,"objectAtIndex:",i))){
return objj_msgSend(self,"_validateDrop:proposedRow:proposedDropOperation:",_222,row,_224);
}
}
return CPDragOperationNone;
}
}),new objj_method(sel_getUid("draggingExited:"),function(self,_227,_228){
with(self){
objj_msgSend(_dropOperationFeedbackView,"removeFromSuperview");
}
}),new objj_method(sel_getUid("draggingEnded:"),function(self,_229,_22a){
with(self){
objj_msgSend(self,"_draggingEnded");
}
}),new objj_method(sel_getUid("_draggingEnded"),function(self,_22b){
with(self){
_retargetedDropOperation=nil;
_retargetedDropRow=nil;
_draggedRowIndexes=objj_msgSend(CPIndexSet,"indexSet");
objj_msgSend(_dropOperationFeedbackView,"removeFromSuperview");
}
}),new objj_method(sel_getUid("wantsPeriodicDraggingUpdates"),function(self,_22c){
with(self){
return YES;
}
}),new objj_method(sel_getUid("_proposedDropOperationAtPoint:"),function(self,_22d,_22e){
with(self){
if(_retargetedDropOperation!==nil){
return _retargetedDropOperation;
}
var row=objj_msgSend(self,"_proposedRowAtPoint:",_22e),_22f=objj_msgSend(self,"rectOfRow:",row);
if(objj_msgSend(self,"intercellSpacing").height<5){
_22f=CPRectInset(_22f,0,5-objj_msgSend(self,"intercellSpacing").height);
}
if(CGRectContainsPoint(_22f,_22e)&&row<_numberOfRows){
return CPTableViewDropOn;
}
return CPTableViewDropAbove;
}
}),new objj_method(sel_getUid("_proposedRowAtPoint:"),function(self,_230,_231){
with(self){
var row=FLOOR(_231.y/(_rowHeight+_intercellSpacing.height));
var _232=row+1,rect=objj_msgSend(self,"rectOfRow:",row),_233=objj_msgSend(self,"rectOfRow:",_232);
if(ABS(CPRectGetMinY(_233)-_231.y)<ABS(_231.y-CPRectGetMinY(rect))){
row=_232;
}
if(row>=objj_msgSend(self,"numberOfRows")){
row=objj_msgSend(self,"numberOfRows");
}
return row;
}
}),new objj_method(sel_getUid("_validateDrop:proposedRow:proposedDropOperation:"),function(self,_234,info,row,_235){
with(self){
if(_implementedDataSourceMethods&_4){
return objj_msgSend(_dataSource,"tableView:validateDrop:proposedRow:proposedDropOperation:",self,info,row,_235);
}
return CPDragOperationNone;
}
}),new objj_method(sel_getUid("_rectForDropHighlightViewOnRow:"),function(self,_236,_237){
with(self){
if(_237>=objj_msgSend(self,"numberOfRows")){
_237=objj_msgSend(self,"numberOfRows")-1;
}
return objj_msgSend(self,"rectOfRow:",_237);
}
}),new objj_method(sel_getUid("_rectForDropHighlightViewBetweenUpperRow:andLowerRow:offset:"),function(self,_238,_239,_23a,_23b){
with(self){
if(_23a>objj_msgSend(self,"numberOfRows")){
_23a=objj_msgSend(self,"numberOfRows");
}
return objj_msgSend(self,"rectOfRow:",_23a);
}
}),new objj_method(sel_getUid("draggingUpdated:"),function(self,_23c,_23d){
with(self){
var _23e=objj_msgSend(self,"convertPoint:fromView:",objj_msgSend(_23d,"draggingLocation"),nil),_23f=objj_msgSend(self,"_proposedDropOperationAtPoint:",_23e),_240=objj_msgSend(self,"numberOfRows");
var row=objj_msgSend(self,"_proposedRowAtPoint:",_23e),_241=objj_msgSend(self,"_validateDrop:proposedRow:proposedDropOperation:",_23d,row,_23f);
exposedClipRect=objj_msgSend(self,"exposedClipRect");
if(_retargetedDropRow!==nil){
row=_retargetedDropRow;
}
if(_23f===CPTableViewDropOn&&row>=objj_msgSend(self,"numberOfRows")){
row=objj_msgSend(self,"numberOfRows")-1;
}
var rect=CPRectMakeZero();
if(row===-1){
rect=exposedClipRect;
}else{
if(_23f===CPTableViewDropAbove){
rect=objj_msgSend(self,"_rectForDropHighlightViewBetweenUpperRow:andLowerRow:offset:",row-1,row,_23e);
}else{
rect=objj_msgSend(self,"_rectForDropHighlightViewOnRow:",row);
}
}
objj_msgSend(_dropOperationFeedbackView,"setDropOperation:",row!==-1?_23f:CPDragOperationNone);
objj_msgSend(_dropOperationFeedbackView,"setHidden:",(_241==CPDragOperationNone));
objj_msgSend(_dropOperationFeedbackView,"setFrame:",rect);
objj_msgSend(_dropOperationFeedbackView,"setCurrentRow:",row);
objj_msgSend(self,"addSubview:",_dropOperationFeedbackView);
if(row>0&&_23e.y-CGRectGetMinY(exposedClipRect)<_rowHeight){
objj_msgSend(self,"scrollRowToVisible:",row-1);
}else{
if(row<_240&&CGRectGetMaxY(exposedClipRect)-_23e.y<_rowHeight){
objj_msgSend(self,"scrollRowToVisible:",row+1);
}
}
return _241;
}
}),new objj_method(sel_getUid("prepareForDragOperation:"),function(self,_242,_243){
with(self){
objj_msgSend(_dropOperationFeedbackView,"removeFromSuperview");
return (_implementedDataSourceMethods&_4);
}
}),new objj_method(sel_getUid("performDragOperation:"),function(self,_244,_245){
with(self){
var _246=objj_msgSend(self,"convertPoint:fromView:",objj_msgSend(_245,"draggingLocation"),nil);
operation=objj_msgSend(self,"_proposedDropOperationAtPoint:",_246),row=_retargetedDropRow;
if(row===nil){
var row=objj_msgSend(self,"_proposedRowAtPoint:",_246);
}
return objj_msgSend(_dataSource,"tableView:acceptDrop:row:dropOperation:",self,_245,row,operation);
}
}),new objj_method(sel_getUid("concludeDragOperation:"),function(self,_247,_248){
with(self){
objj_msgSend(self,"reloadData");
}
}),new objj_method(sel_getUid("draggedImage:endedAt:operation:"),function(self,_249,_24a,_24b,_24c){
with(self){
if(objj_msgSend(_dataSource,"respondsToSelector:",sel_getUid("tableView:didEndDraggedImage:atPosition:operation:"))){
objj_msgSend(_dataSource,"tableView:didEndDraggedImage:atPosition:operation:",self,_24a,_24b,_24c);
}
}
}),new objj_method(sel_getUid("draggedView:endedAt:operation:"),function(self,_24d,_24e,_24f,_250){
with(self){
objj_msgSend(self,"_draggingEnded");
objj_msgSend(self,"draggedImage:endedAt:operation:",_24e,_24f,_250);
}
}),new objj_method(sel_getUid("_updateSelectionWithMouseAtRow:"),function(self,_251,aRow){
with(self){
if(aRow<0){
return;
}
var _252,_253=NO;
if(objj_msgSend(self,"mouseDownFlags")&(CPCommandKeyMask|CPControlKeyMask|CPAlternateKeyMask)){
if(objj_msgSend(_selectedRowIndexes,"containsIndex:",aRow)){
_252=objj_msgSend(_selectedRowIndexes,"copy");
objj_msgSend(_252,"removeIndex:",aRow);
}else{
if(_allowsMultipleSelection){
_252=objj_msgSend(_selectedRowIndexes,"copy");
objj_msgSend(_252,"addIndex:",aRow);
}else{
_252=objj_msgSend(CPIndexSet,"indexSetWithIndex:",aRow);
}
}
}else{
if(_allowsMultipleSelection){
_252=objj_msgSend(CPIndexSet,"indexSetWithIndexesInRange:",CPMakeRange(MIN(aRow,_selectionAnchorRow),ABS(aRow-_selectionAnchorRow)+1));
_253=objj_msgSend(self,"mouseDownFlags")&CPShiftKeyMask&&((_lastSelectedRow==objj_msgSend(_selectedRowIndexes,"lastIndex")&&aRow>_lastSelectedRow)||(_lastSelectedRow==objj_msgSend(_selectedRowIndexes,"firstIndex")&&aRow<_lastSelectedRow));
}else{
if(aRow>=0&&aRow<_numberOfRows){
_252=objj_msgSend(CPIndexSet,"indexSetWithIndex:",aRow);
}else{
_252=objj_msgSend(CPIndexSet,"indexSet");
}
}
}
if(objj_msgSend(_252,"isEqualToIndexSet:",_selectedRowIndexes)){
return;
}
if(_implementedDelegateMethods&_7&&!objj_msgSend(_delegate,"selectionShouldChangeInTableView:",self)){
return;
}
if(_implementedDelegateMethods&_f){
_252=objj_msgSend(_delegate,"tableView:selectionIndexesForProposedSelection:",self,_252);
}
if(_implementedDelegateMethods&_11){
var _254=[];
objj_msgSend(_252,"getIndexes:maxCount:inIndexRange:",_254,-1,nil);
var _255=_254.length;
while(_255--){
var _256=_254[_255];
if(!objj_msgSend(_delegate,"tableView:shouldSelectRow:",self,_256)){
objj_msgSend(_252,"removeIndex:",_256);
}
}
}
_lastSelectedRow=(objj_msgSend(_252,"count")>0)?aRow:-1;
if(!_allowsEmptySelection&&objj_msgSend(_252,"count")===0){
return;
}
if(objj_msgSend(_252,"isEqualToIndexSet:",_selectedRowIndexes)){
return;
}
objj_msgSend(self,"selectRowIndexes:byExtendingSelection:",_252,_253);
}
}),new objj_method(sel_getUid("_noteSelectionIsChanging"),function(self,_257){
with(self){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:userInfo:",CPTableViewSelectionIsChangingNotification,self,nil);
}
}),new objj_method(sel_getUid("_noteSelectionDidChange"),function(self,_258){
with(self){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:userInfo:",CPTableViewSelectionDidChangeNotification,self,nil);
}
}),new objj_method(sel_getUid("becomeFirstResponder"),function(self,_259){
with(self){
return YES;
}
}),new objj_method(sel_getUid("acceptsFirstResponder"),function(self,_25a){
with(self){
return YES;
}
}),new objj_method(sel_getUid("keyDown:"),function(self,_25b,_25c){
with(self){
objj_msgSend(self,"interpretKeyEvents:",objj_msgSend(CPArray,"arrayWithObject:",_25c));
}
}),new objj_method(sel_getUid("moveDown:"),function(self,_25d,_25e){
with(self){
if(_implementedDelegateMethods&_7&&!objj_msgSend(_delegate,"selectionShouldChangeInTableView:",self)){
return;
}
var _25f=objj_msgSend(CPApp,"currentEvent");
if(objj_msgSend(objj_msgSend(self,"selectedRowIndexes"),"count")>0){
var _260=NO;
if((objj_msgSend(_25f,"modifierFlags")&CPShiftKeyMask)&&_allowsMultipleSelection){
_260=YES;
}
var i=objj_msgSend(objj_msgSend(self,"selectedRowIndexes"),"lastIndex");
if(i<objj_msgSend(self,"numberOfRows")-1){
i++;
}
}else{
var _260=NO;
if(objj_msgSend(self,"numberOfRows")>0){
var i=0;
}
}
if(_implementedDelegateMethods&_11){
while((!objj_msgSend(_delegate,"tableView:shouldSelectRow:",self,i))&&i<objj_msgSend(self,"numberOfRows")){
i++;
}
if(!objj_msgSend(_delegate,"tableView:shouldSelectRow:",self,i)){
return;
}
}
objj_msgSend(self,"selectRowIndexes:byExtendingSelection:",objj_msgSend(CPIndexSet,"indexSetWithIndex:",i),_260);
if(i>=0){
objj_msgSend(self,"scrollRowToVisible:",i);
}
}
}),new objj_method(sel_getUid("moveUp:"),function(self,_261,_262){
with(self){
if(_implementedDelegateMethods&_7&&!objj_msgSend(_delegate,"selectionShouldChangeInTableView:",self)){
return;
}
var _263=objj_msgSend(CPApp,"currentEvent");
if(objj_msgSend(objj_msgSend(self,"selectedRowIndexes"),"count")>0){
var _264=NO;
if((objj_msgSend(_263,"modifierFlags")&CPShiftKeyMask)&&_allowsMultipleSelection){
_264=YES;
}
var i=objj_msgSend(objj_msgSend(self,"selectedRowIndexes"),"firstIndex");
if(i>0){
i--;
}
}else{
var _264=NO;
if(objj_msgSend(self,"numberOfRows")>0){
var i=objj_msgSend(self,"numberOfRows")-1;
}
}
if(_implementedDelegateMethods&_11){
while((!objj_msgSend(_delegate,"tableView:shouldSelectRow:",self,i))&&i>0){
i--;
}
if(!objj_msgSend(_delegate,"tableView:shouldSelectRow:",self,i)){
return;
}
}
objj_msgSend(self,"selectRowIndexes:byExtendingSelection:",objj_msgSend(CPIndexSet,"indexSetWithIndex:",i),_264);
if(i>=0){
objj_msgSend(self,"scrollRowToVisible:",i);
}
}
}),new objj_method(sel_getUid("deleteBackward:"),function(self,_265,_266){
with(self){
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tableViewDeleteKeyPressed:"))){
objj_msgSend(_delegate,"tableViewDeleteKeyPressed:",self);
}
}
})]);
class_addMethods(_1c,[new objj_method(sel_getUid("_defaultTableHeaderSortImage"),function(self,_267){
with(self){
return CPAppKitImage("tableview-headerview-ascending.png",CGSizeMake(9,8));
}
}),new objj_method(sel_getUid("_defaultTableHeaderReverseSortImage"),function(self,_268){
with(self){
return CPAppKitImage("tableview-headerview-descending.png",CGSizeMake(9,8));
}
})]);
var _269="CPTableViewDataSourceKey",_26a="CPTableViewDelegateKey",_26b="CPTableViewHeaderViewKey",_26c="CPTableViewTableColumnsKey",_26d="CPTableViewRowHeightKey",_26e="CPTableViewIntercellSpacingKey",_26f="CPTableViewMultipleSelectionKey",_270="CPTableViewEmptySelectionKey",_271="CPTableViewColumnReorderingKey",_272="CPTableViewColumnResizingKey",_273="CPTableViewColumnSelectionKey",_274="CPTableViewGridColorKey",_275="CPTableViewGridStyleMaskKey",_276="CPTableViewUsesAlternatingBackgroundKey",_277="CPTableViewAlternatingRowColorsKey",_26b="CPTableViewHeaderViewKey",_278="CPTableViewCornerViewKey";
var _1b=objj_getClass("CPTableView");
if(!_1b){
throw new SyntaxError("*** Could not find definition for class \"CPTableView\"");
}
var _1c=_1b.isa;
class_addMethods(_1b,[new objj_method(sel_getUid("initWithCoder:"),function(self,_279,_27a){
with(self){
self=objj_msgSendSuper({receiver:self,super_class:objj_getClass("CPTableView").super_class},"initWithCoder:",_27a);
if(self){
_allowsColumnReordering=objj_msgSend(_27a,"decodeBoolForKey:",_271);
_allowsColumnResizing=objj_msgSend(_27a,"decodeBoolForKey:",_272);
_allowsMultipleSelection=objj_msgSend(_27a,"decodeBoolForKey:",_26f);
_allowsEmptySelection=objj_msgSend(_27a,"decodeBoolForKey:",_270);
_allowsColumnSelection=objj_msgSend(_27a,"decodeBoolForKey:",_273);
_tableViewFlags=0;
_selectionHighlightStyle=CPTableViewSelectionHighlightStyleRegular;
_usesAlternatingRowBackgroundColors=objj_msgSend(_27a,"decodeBoolForKey:",_276);
objj_msgSend(self,"setAlternatingRowBackgroundColors:",[objj_msgSend(CPColor,"whiteColor"),objj_msgSend(CPColor,"colorWithHexString:","e4e7ff")]);
_tableColumns=objj_msgSend(_27a,"decodeObjectForKey:",_26c);
objj_msgSend(_tableColumns,"makeObjectsPerformSelector:withObject:",sel_getUid("setTableView:"),self);
_tableColumnRanges=[];
_dirtyTableColumnRangeIndex=0;
_numberOfHiddenColumns=0;
_objectValues={};
_dataViewsForTableColumns={};
_dataViews=[];
_numberOfRows=0;
_exposedRows=objj_msgSend(CPIndexSet,"indexSet");
_exposedColumns=objj_msgSend(CPIndexSet,"indexSet");
_cachedDataViews={};
_rowHeight=objj_msgSend(_27a,"decodeFloatForKey:",_26d);
if(objj_msgSend(_27a,"containsValueForKey:",_26e)){
_intercellSpacing=objj_msgSend(_27a,"decodeSizeForKey:",_26e);
}else{
_intercellSpacing={width:0,height:0};
}
_gridColor=objj_msgSend(_27a,"decodeObjectForKey:",_274)||objj_msgSend(CPColor,"grayColor");
_gridStyleMask=objj_msgSend(_27a,"decodeIntForKey:",_275)||CPTableViewGridNone;
_alternatingRowBackgroundColors=objj_msgSend(_27a,"decodeObjectForKey:",_277);
_usesAlternatingRowBackgroundColors=objj_msgSend(_27a,"decodeObjectForKey:",_276);
_headerView=objj_msgSend(_27a,"decodeObjectForKey:",_26b);
_cornerView=objj_msgSend(_27a,"decodeObjectForKey:",_278);
_selectedColumnIndexes=objj_msgSend(CPIndexSet,"indexSet");
_selectedRowIndexes=objj_msgSend(CPIndexSet,"indexSet");
_dataSource=objj_msgSend(_27a,"decodeObjectForKey:",_269);
_delegate=objj_msgSend(_27a,"decodeObjectForKey:",_26a);
_tableDrawView=objj_msgSend(objj_msgSend(_CPTableDrawView,"alloc"),"initWithTableView:",self);
objj_msgSend(_tableDrawView,"setBackgroundColor:",objj_msgSend(CPColor,"clearColor"));
objj_msgSend(self,"addSubview:",_tableDrawView);
objj_msgSend(self,"_init");
objj_msgSend(self,"viewWillMoveToSuperview:",objj_msgSend(self,"superview"));
}
return self;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(self,_27b,_27c){
with(self){
objj_msgSendSuper({receiver:self,super_class:objj_getClass("CPTableView").super_class},"encodeWithCoder:",_27c);
objj_msgSend(_27c,"encodeObject:forKey:",_dataSource,_269);
objj_msgSend(_27c,"encodeObject:forKey:",_delegate,_26a);
objj_msgSend(_27c,"encodeFloat:forKey:",_rowHeight,_26d);
objj_msgSend(_27c,"encodeSize:forKey:",_intercellSpacing,_26e);
objj_msgSend(_27c,"encodeBool:forKey:",_allowsMultipleSelection,_26f);
objj_msgSend(_27c,"encodeBool:forKey:",_allowsEmptySelection,_270);
objj_msgSend(_27c,"encodeBool:forKey:",_allowsColumnReordering,_271);
objj_msgSend(_27c,"encodeBool:forKey:",_allowsColumnResizing,_272);
objj_msgSend(_27c,"encodeBool:forKey:",_allowsColumnSelection,_273);
objj_msgSend(_27c,"encodeObject:forKey:",_tableColumns,_26c);
objj_msgSend(_27c,"encodeObject:forKey:",_gridColor,_274);
objj_msgSend(_27c,"encodeInt:forKey:",_gridStyleMask,_275);
objj_msgSend(_27c,"encodeBool:forKey:",_usesAlternatingRowBackgroundColors,_276);
objj_msgSend(_27c,"encodeObject:forKey:",_alternatingRowBackgroundColors,_277);
objj_msgSend(_27c,"encodeObject:forKey:",_cornerView,_278);
objj_msgSend(_27c,"encodeObject:forKey:",_headerView,_26b);
}
})]);
var _1b=objj_getClass("CPColor");
if(!_1b){
throw new SyntaxError("*** Could not find definition for class \"CPColor\"");
}
var _1c=_1b.isa;
class_addMethods(_1c,[new objj_method(sel_getUid("selectionColor"),function(self,_27d){
with(self){
return objj_msgSend(CPColor,"colorWithHexString:","5f83b9");
}
}),new objj_method(sel_getUid("selectionColorSourceView"),function(self,_27e){
with(self){
return objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initByReferencingFile:size:","Resources/tableviewselection.png",CGSizeMake(6,22)));
}
})]);
var _1b=objj_getClass("CPIndexSet");
if(!_1b){
throw new SyntaxError("*** Could not find definition for class \"CPIndexSet\"");
}
var _1c=_1b.isa;
class_addMethods(_1b,[new objj_method(sel_getUid("removeMatches:"),function(self,_27f,_280){
with(self){
var _281=objj_msgSend(self,"firstIndex");
var _282=MIN(_281,objj_msgSend(_280,"firstIndex"));
var _283=(_282==_281);
while(_282!=CPNotFound){
var _284=(_283)?_280:self;
otherIndex=objj_msgSend(_284,"indexGreaterThanOrEqualToIndex:",_282);
if(otherIndex==_282){
objj_msgSend(self,"removeIndex:",_282);
objj_msgSend(_280,"removeIndex:",_282);
}
_282=otherIndex;
_283=!_283;
}
}
})]);
var _1b=objj_allocateClassPair(CPView,"_dropOperationDrawingView"),_1c=_1b.isa;
class_addIvars(_1b,[new objj_ivar("dropOperation"),new objj_ivar("tableView"),new objj_ivar("currentRow")]);
objj_registerClassPair(_1b);
class_addMethods(_1b,[new objj_method(sel_getUid("dropOperation"),function(self,_285){
with(self){
return dropOperation;
}
}),new objj_method(sel_getUid("setDropOperation:"),function(self,_286,_287){
with(self){
dropOperation=_287;
}
}),new objj_method(sel_getUid("tableView"),function(self,_288){
with(self){
return tableView;
}
}),new objj_method(sel_getUid("setTableView:"),function(self,_289,_28a){
with(self){
tableView=_28a;
}
}),new objj_method(sel_getUid("currentRow"),function(self,_28b){
with(self){
return currentRow;
}
}),new objj_method(sel_getUid("setCurrentRow:"),function(self,_28c,_28d){
with(self){
currentRow=_28d;
}
}),new objj_method(sel_getUid("drawRect:"),function(self,_28e,_28f){
with(self){
if(tableView._destinationDragStyle===CPTableViewDraggingDestinationFeedbackStyleNone){
return;
}
var _290=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort");
CGContextSetStrokeColor(_290,objj_msgSend(CPColor,"colorWithHexString:","4886ca"));
CGContextSetLineWidth(_290,3);
if(currentRow===-1){
CGContextStrokeRect(_290,objj_msgSend(self,"bounds"));
}else{
if(dropOperation===CPTableViewDropOn){
var _291=objj_msgSend(tableView,"selectedRowIndexes"),_292={origin:{x:_28f.origin.x+2,y:_28f.origin.y+2},size:{width:_28f.size.width-4,height:_28f.size.height-5}};
if(objj_msgSend(_291,"containsIndex:",currentRow)){
CGContextSetLineWidth(_290,2);
CGContextSetStrokeColor(_290,objj_msgSend(CPColor,"whiteColor"));
}else{
CGContextSetFillColor(_290,objj_msgSend(CPColor,"colorWithRed:green:blue:alpha:",72/255,134/255,202/255,0.25));
CGContextFillRoundedRectangleInRect(_290,_292,8,YES,YES,YES,YES);
}
CGContextStrokeRoundedRectangleInRect(_290,_292,8,YES,YES,YES,YES);
}else{
if(dropOperation===CPTableViewDropAbove){
objj_msgSend(self,"setFrameOrigin:",CGPointMake(_frame.origin.x,_frame.origin.y-8));
var _291=objj_msgSend(tableView,"selectedRowIndexes");
if(objj_msgSend(_291,"containsIndex:",currentRow-1)||objj_msgSend(_291,"containsIndex:",currentRow)){
CGContextSetStrokeColor(_290,objj_msgSend(CPColor,"whiteColor"));
CGContextSetLineWidth(_290,4);
CGContextStrokeEllipseInRect(_290,{origin:{x:_28f.origin.x+4,y:_28f.origin.y+4},size:{width:8,height:8}});
CGContextBeginPath(_290);
CGContextMoveToPoint(_290,10,_28f.origin.y+8);
CGContextAddLineToPoint(_290,_28f.size.width-_28f.origin.y-8,_28f.origin.y+8);
CGContextClosePath(_290);
CGContextStrokePath(_290);
CGContextSetStrokeColor(_290,objj_msgSend(CPColor,"colorWithHexString:","4886ca"));
CGContextSetLineWidth(_290,3);
}
CGContextStrokeEllipseInRect(_290,{origin:{x:_28f.origin.x+4,y:_28f.origin.y+4},size:{width:8,height:8}});
CGContextBeginPath(_290);
CGContextMoveToPoint(_290,10,_28f.origin.y+8);
CGContextAddLineToPoint(_290,_28f.size.width-_28f.origin.y-8,_28f.origin.y+8);
CGContextClosePath(_290);
CGContextStrokePath(_290);
}
}
}
}
})]);
p;11;CPTabView.jt;18789;@STATIC;1.0;i;13;CPImageView.ji;15;CPTabViewItem.ji;8;CPView.jt;18719;
objj_executeFile("CPImageView.j",YES);
objj_executeFile("CPTabViewItem.j",YES);
objj_executeFile("CPView.j",YES);
CPTopTabsBezelBorder=0;
CPNoTabsBezelBorder=4;
CPNoTabsLineBorder=5;
CPNoTabsNoBorder=6;
var _1=nil,_2=nil,_3=nil,_4=nil,_5=nil;
var _6=7,_7=7;
var _8=1,_9=2,_a=4,_b=8;
var _c=objj_allocateClassPair(CPView,"CPTabView"),_d=_c.isa;
class_addIvars(_c,[new objj_ivar("_labelsView"),new objj_ivar("_backgroundView"),new objj_ivar("_separatorView"),new objj_ivar("_auxiliaryView"),new objj_ivar("_contentView"),new objj_ivar("_tabViewItems"),new objj_ivar("_selectedTabViewItem"),new objj_ivar("_tabViewType"),new objj_ivar("_delegate"),new objj_ivar("_delegateSelectors")]);
objj_registerClassPair(_c);
class_addMethods(_c,[new objj_method(sel_getUid("initWithFrame:"),function(_e,_f,_10){
with(_e){
_e=objj_msgSendSuper({receiver:_e,super_class:objj_getClass("CPTabView").super_class},"initWithFrame:",_10);
if(_e){
_tabViewType=CPTopTabsBezelBorder;
_tabViewItems=[];
}
return _e;
}
}),new objj_method(sel_getUid("viewDidMoveToWindow"),function(_11,_12){
with(_11){
if(_tabViewType!=CPTopTabsBezelBorder||_labelsView){
return;
}
objj_msgSend(_11,"_createBezelBorder");
objj_msgSend(_11,"layoutSubviews");
}
}),new objj_method(sel_getUid("_createBezelBorder"),function(_13,_14){
with(_13){
var _15=objj_msgSend(_13,"bounds");
_labelsView=objj_msgSend(objj_msgSend(_CPTabLabelsView,"alloc"),"initWithFrame:",CGRectMake(0,0,CGRectGetWidth(_15),0));
objj_msgSend(_labelsView,"setTabView:",_13);
objj_msgSend(_labelsView,"setAutoresizingMask:",CPViewWidthSizable);
objj_msgSend(_13,"addSubview:",_labelsView);
_backgroundView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMakeZero());
objj_msgSend(_backgroundView,"setBackgroundColor:",_5);
objj_msgSend(_backgroundView,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
objj_msgSend(_13,"addSubview:",_backgroundView);
_separatorView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMakeZero());
objj_msgSend(_separatorView,"setBackgroundColor:",objj_msgSend(objj_msgSend(_13,"class"),"bezelBorderColor"));
objj_msgSend(_separatorView,"setAutoresizingMask:",CPViewWidthSizable|CPViewMaxYMargin);
objj_msgSend(_13,"addSubview:",_separatorView);
}
}),new objj_method(sel_getUid("layoutSubviews"),function(_16,_17){
with(_16){
if(_tabViewType==CPTopTabsBezelBorder){
var _18=objj_msgSend(_16,"bounds"),_19=objj_msgSend(_CPTabLabelsView,"height");
_18.origin.y+=_19;
_18.size.height-=_19;
objj_msgSend(_backgroundView,"setFrame:",_18);
var _1a=5;
if(_auxiliaryView){
_1a=CGRectGetHeight(objj_msgSend(_auxiliaryView,"frame"));
objj_msgSend(_auxiliaryView,"setFrame:",CGRectMake(_6,_19,CGRectGetWidth(_18)-_6-_7,_1a));
}
objj_msgSend(_separatorView,"setFrame:",CGRectMake(_6,_19+_1a,CGRectGetWidth(_18)-_6-_7,1));
}
objj_msgSend(_contentView,"setFrame:",objj_msgSend(_16,"contentRect"));
}
}),new objj_method(sel_getUid("addTabViewItem:"),function(_1b,_1c,_1d){
with(_1b){
objj_msgSend(_1b,"insertTabViewItem:atIndex:",_1d,objj_msgSend(_tabViewItems,"count"));
}
}),new objj_method(sel_getUid("insertTabViewItem:atIndex:"),function(_1e,_1f,_20,_21){
with(_1e){
if(!_labelsView&&_tabViewType==CPTopTabsBezelBorder){
objj_msgSend(_1e,"_createBezelBorder");
}
objj_msgSend(_tabViewItems,"insertObject:atIndex:",_20,_21);
objj_msgSend(_labelsView,"tabView:didAddTabViewItem:",_1e,_20);
objj_msgSend(_20,"_setTabView:",_1e);
if(objj_msgSend(_tabViewItems,"count")==1){
objj_msgSend(_1e,"selectFirstTabViewItem:",_1e);
}
if(_delegateSelectors&_b){
objj_msgSend(_delegate,"tabViewDidChangeNumberOfTabViewItems:",_1e);
}
}
}),new objj_method(sel_getUid("removeTabViewItem:"),function(_22,_23,_24){
with(_22){
var _25=objj_msgSend(_22,"indexOfTabViewItem:",_24);
objj_msgSend(_tabViewItems,"removeObjectIdenticalTo:",_24);
objj_msgSend(_labelsView,"tabView:didRemoveTabViewItemAtIndex:",_22,_25);
objj_msgSend(_24,"_setTabView:",nil);
if(_delegateSelectors&_b){
objj_msgSend(_delegate,"tabViewDidChangeNumberOfTabViewItems:",_22);
}
}
}),new objj_method(sel_getUid("indexOfTabViewItem:"),function(_26,_27,_28){
with(_26){
return objj_msgSend(_tabViewItems,"indexOfObjectIdenticalTo:",_28);
}
}),new objj_method(sel_getUid("indexOfTabViewItemWithIdentifier:"),function(_29,_2a,_2b){
with(_29){
var _2c=0,_2d=objj_msgSend(_tabViewItems,"count");
for(;_2c<_2d;++_2c){
if(objj_msgSend(objj_msgSend(_tabViewItems[_2c],"identifier"),"isEqual:",_2b)){
return _2c;
}
}
return _2c;
}
}),new objj_method(sel_getUid("numberOfTabViewItems"),function(_2e,_2f){
with(_2e){
return objj_msgSend(_tabViewItems,"count");
}
}),new objj_method(sel_getUid("tabViewItemAtIndex:"),function(_30,_31,_32){
with(_30){
return _tabViewItems[_32];
}
}),new objj_method(sel_getUid("tabViewItems"),function(_33,_34){
with(_33){
return _tabViewItems;
}
}),new objj_method(sel_getUid("selectFirstTabViewItem:"),function(_35,_36,_37){
with(_35){
var _38=objj_msgSend(_tabViewItems,"count");
if(_38){
objj_msgSend(_35,"selectTabViewItemAtIndex:",0);
}
}
}),new objj_method(sel_getUid("selectLastTabViewItem:"),function(_39,_3a,_3b){
with(_39){
var _3c=objj_msgSend(_tabViewItems,"count");
if(_3c){
objj_msgSend(_39,"selectTabViewItemAtIndex:",_3c-1);
}
}
}),new objj_method(sel_getUid("selectNextTabViewItem:"),function(_3d,_3e,_3f){
with(_3d){
if(!_selectedTabViewItem){
return;
}
var _40=objj_msgSend(_3d,"indexOfTabViewItem:",_selectedTabViewItem),_41=objj_msgSend(_tabViewItems,"count");
objj_msgSend(_3d,"selectTabViewItemAtIndex:",_40+1%_41);
}
}),new objj_method(sel_getUid("selectPreviousTabViewItem:"),function(_42,_43,_44){
with(_42){
if(!_selectedTabViewItem){
return;
}
var _45=objj_msgSend(_42,"indexOfTabViewItem:",_selectedTabViewItem),_46=objj_msgSend(_tabViewItems,"count");
objj_msgSend(_42,"selectTabViewItemAtIndex:",_45==0?_46:_45-1);
}
}),new objj_method(sel_getUid("selectTabViewItem:"),function(_47,_48,_49){
with(_47){
if((_delegateSelectors&_9)&&!objj_msgSend(_delegate,"tabView:shouldSelectTabViewItem:",_47,_49)){
return;
}
if(_delegateSelectors&_a){
objj_msgSend(_delegate,"tabView:willSelectTabViewItem:",_47,_49);
}
if(_selectedTabViewItem){
_selectedTabViewItem._tabState=CPBackgroundTab;
objj_msgSend(_labelsView,"tabView:didChangeStateOfTabViewItem:",_47,_selectedTabViewItem);
objj_msgSend(_contentView,"removeFromSuperview");
objj_msgSend(_auxiliaryView,"removeFromSuperview");
}
_selectedTabViewItem=_49;
_selectedTabViewItem._tabState=CPSelectedTab;
_contentView=objj_msgSend(_selectedTabViewItem,"view");
objj_msgSend(_contentView,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
_auxiliaryView=objj_msgSend(_selectedTabViewItem,"auxiliaryView");
objj_msgSend(_auxiliaryView,"setAutoresizingMask:",CPViewWidthSizable);
objj_msgSend(_47,"addSubview:",_contentView);
if(_auxiliaryView){
objj_msgSend(_47,"addSubview:",_auxiliaryView);
}
objj_msgSend(_labelsView,"tabView:didChangeStateOfTabViewItem:",_47,_selectedTabViewItem);
objj_msgSend(_47,"layoutSubviews");
if(_delegateSelectors&_8){
objj_msgSend(_delegate,"tabView:didSelectTabViewItem:",_47,_49);
}
}
}),new objj_method(sel_getUid("selectTabViewItemAtIndex:"),function(_4a,_4b,_4c){
with(_4a){
objj_msgSend(_4a,"selectTabViewItem:",_tabViewItems[_4c]);
}
}),new objj_method(sel_getUid("selectedTabViewItem"),function(_4d,_4e){
with(_4d){
return _selectedTabViewItem;
}
}),new objj_method(sel_getUid("setTabViewType:"),function(_4f,_50,_51){
with(_4f){
if(_tabViewType==_51){
return;
}
_tabViewType=_51;
if(_tabViewType==CPNoTabsBezelBorder||_tabViewType==CPNoTabsLineBorder||_tabViewType==CPNoTabsNoBorder){
objj_msgSend(_labelsView,"removeFromSuperview");
}else{
if(!objj_msgSend(_labelsView,"superview")){
objj_msgSend(_4f,"addSubview:",_labelsView);
}
}
if(_tabViewType==CPNoTabsLineBorder||_tabViewType==CPNoTabsNoBorder){
objj_msgSend(_backgroundView,"removeFromSuperview");
}else{
if(!objj_msgSend(_backgroundView,"superview")){
objj_msgSend(_4f,"addSubview:",_backgroundView);
}
}
objj_msgSend(_4f,"layoutSubviews");
}
}),new objj_method(sel_getUid("tabViewType"),function(_52,_53){
with(_52){
return _tabViewType;
}
}),new objj_method(sel_getUid("contentRect"),function(_54,_55){
with(_54){
var _56=CGRectMakeCopy(objj_msgSend(_54,"bounds"));
if(_tabViewType==CPTopTabsBezelBorder){
var _57=objj_msgSend(_CPTabLabelsView,"height"),_58=_auxiliaryView?CGRectGetHeight(objj_msgSend(_auxiliaryView,"frame")):5,_59=1;
_56.origin.y+=_57+_58+_59;
_56.size.height-=_57+_58+_59*2;
_56.origin.x+=_6;
_56.size.width-=_6+_7;
}
return _56;
}
}),new objj_method(sel_getUid("delegate"),function(_5a,_5b){
with(_5a){
return _delegate;
}
}),new objj_method(sel_getUid("setDelegate:"),function(_5c,_5d,_5e){
with(_5c){
if(_delegate==_5e){
return;
}
_delegate=_5e;
_delegateSelectors=0;
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tabView:shouldSelectTabViewItem:"))){
_delegateSelectors|=_9;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tabView:willSelectTabViewItem:"))){
_delegateSelectors|=_a;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tabView:didSelectTabViewItem:"))){
_delegateSelectors|=_8;
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tabViewDidChangeNumberOfTabViewItems:"))){
_delegateSelectors|=_b;
}
}
}),new objj_method(sel_getUid("mouseDown:"),function(_5f,_60,_61){
with(_5f){
var _62=objj_msgSend(_labelsView,"convertPoint:fromView:",objj_msgSend(_61,"locationInWindow"),nil),_63=objj_msgSend(_labelsView,"representedTabViewItemAtPoint:",_62);
if(_63){
objj_msgSend(_5f,"selectTabViewItem:",_63);
}
}
})]);
class_addMethods(_d,[new objj_method(sel_getUid("initialize"),function(_64,_65){
with(_64){
if(_64!=CPTabView){
return;
}
var _66=objj_msgSend(CPBundle,"bundleForClass:",_64),_67=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initByReferencingFile:size:","",CGSizeMake(7,0)),_68=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_66,"pathForResource:","CPTabView/CPTabViewBezelBackgroundCenter.png"),CGSizeMake(1,1)),_69=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_66,"pathForResource:","CPTabView/CPTabViewBezelBorderLeft.png"),CGSizeMake(7,1)),_6a=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_66,"pathForResource:","CPTabView/CPTabViewBezelBorder.png"),CGSizeMake(1,1)),_6b=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_66,"pathForResource:","CPTabView/CPTabViewBezelBorderRight.png"),CGSizeMake(7,1));
_5=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPNinePartImage,"alloc"),"initWithImageSlices:",[_67,_67,_67,_69,_68,_6b,_69,_6a,_6b]));
_4=objj_msgSend(CPColor,"colorWithPatternImage:",_6a);
}
}),new objj_method(sel_getUid("bezelBorderColor"),function(_6c,_6d){
with(_6c){
return _4;
}
})]);
var _6e="CPTabViewItemsKey",_6f="CPTabViewSelectedItemKey",_70="CPTabViewTypeKey",_71="CPTabViewDelegateKey";
var _c=objj_getClass("CPTabView");
if(!_c){
throw new SyntaxError("*** Could not find definition for class \"CPTabView\"");
}
var _d=_c.isa;
class_addMethods(_c,[new objj_method(sel_getUid("initWithCoder:"),function(_72,_73,_74){
with(_72){
if(_72=objj_msgSendSuper({receiver:_72,super_class:objj_getClass("CPTabView").super_class},"initWithCoder:",_74)){
_tabViewType=objj_msgSend(_74,"decodeIntForKey:",_70);
_tabViewItems=[];
objj_msgSend(_72,"_createBezelBorder");
var _75=objj_msgSend(_74,"decodeObjectForKey:",_6e);
for(var i=0;_75&&i<_75.length;i++){
objj_msgSend(_72,"insertTabViewItem:atIndex:",_75[i],i);
}
var _76=objj_msgSend(_74,"decodeObjectForKey:",_6f);
if(_76){
objj_msgSend(_72,"selectTabViewItem:",_76);
}
objj_msgSend(_72,"setDelegate:",objj_msgSend(_74,"decodeObjectForKey:",_71));
}
return _72;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_77,_78,_79){
with(_77){
var _7a=_subviews;
_subviews=[];
objj_msgSendSuper({receiver:_77,super_class:objj_getClass("CPTabView").super_class},"encodeWithCoder:",_79);
_subviews=_7a;
objj_msgSend(_79,"encodeObject:forKey:",_tabViewItems,_6e);
objj_msgSend(_79,"encodeObject:forKey:",_selectedTabViewItem,_6f);
objj_msgSend(_79,"encodeInt:forKey:",_tabViewType,_70);
objj_msgSend(_79,"encodeConditionalObject:forKey:",_delegate,_71);
}
})]);
var _7b=nil,_7c=10,_7d=15;
var _c=objj_allocateClassPair(CPView,"_CPTabLabelsView"),_d=_c.isa;
class_addIvars(_c,[new objj_ivar("_tabView"),new objj_ivar("_tabLabels")]);
objj_registerClassPair(_c);
class_addMethods(_c,[new objj_method(sel_getUid("initWithFrame:"),function(_7e,_7f,_80){
with(_7e){
_7e=objj_msgSendSuper({receiver:_7e,super_class:objj_getClass("_CPTabLabelsView").super_class},"initWithFrame:",_80);
if(_7e){
_tabLabels=[];
objj_msgSend(_7e,"setBackgroundColor:",_7b);
objj_msgSend(_7e,"setFrameSize:",CGSizeMake(CGRectGetWidth(_80),26));
}
return _7e;
}
}),new objj_method(sel_getUid("setTabView:"),function(_81,_82,_83){
with(_81){
_tabView=_83;
}
}),new objj_method(sel_getUid("tabView"),function(_84,_85){
with(_84){
return _tabView;
}
}),new objj_method(sel_getUid("tabView:didAddTabViewItem:"),function(_86,_87,_88,_89){
with(_86){
var _8a=objj_msgSend(objj_msgSend(_CPTabLabel,"alloc"),"initWithFrame:",CGRectMakeZero());
objj_msgSend(_8a,"setTabViewItem:",_89);
_tabLabels.push(_8a);
objj_msgSend(_86,"addSubview:",_8a);
objj_msgSend(_86,"layoutSubviews");
}
}),new objj_method(sel_getUid("tabView:didRemoveTabViewItemAtIndex:"),function(_8b,_8c,_8d,_8e){
with(_8b){
var _8f=_tabLabels[_8e];
objj_msgSend(_tabLabels,"removeObjectAtIndex:",_8e);
objj_msgSend(_8f,"removeFromSuperview");
objj_msgSend(_8b,"layoutSubviews");
}
}),new objj_method(sel_getUid("tabView:didChangeStateOfTabViewItem:"),function(_90,_91,_92,_93){
with(_90){
objj_msgSend(_tabLabels[objj_msgSend(_92,"indexOfTabViewItem:",_93)],"setTabState:",objj_msgSend(_93,"tabState"));
}
}),new objj_method(sel_getUid("representedTabViewItemAtPoint:"),function(_94,_95,_96){
with(_94){
var _97=0,_98=_tabLabels.length;
for(;_97<_98;++_97){
var _99=_tabLabels[_97];
if(CGRectContainsPoint(objj_msgSend(_99,"frame"),_96)){
return objj_msgSend(_99,"tabViewItem");
}
}
return nil;
}
}),new objj_method(sel_getUid("layoutSubviews"),function(_9a,_9b){
with(_9a){
var _9c=0,_9d=_tabLabels.length,_9e=((objj_msgSend(_9a,"bounds").size.width)-(_9d-1)*_7c-2*_7d)/_9d,x=_7d;
for(;_9c<_9d;++_9c){
var _9f=_tabLabels[_9c],_a0={origin:{x:x,y:8},size:{width:_9e,height:18}};
objj_msgSend(_9f,"setFrame:",_a0);
x=(_a0.origin.x+_a0.size.width)+_7c;
}
}
}),new objj_method(sel_getUid("setFrameSize:"),function(_a1,_a2,_a3){
with(_a1){
if(CGSizeEqualToSize(objj_msgSend(_a1,"frame").size,_a3)){
return;
}
objj_msgSendSuper({receiver:_a1,super_class:objj_getClass("_CPTabLabelsView").super_class},"setFrameSize:",_a3);
objj_msgSend(_a1,"layoutSubviews");
}
})]);
class_addMethods(_d,[new objj_method(sel_getUid("initialize"),function(_a4,_a5){
with(_a4){
if(_a4!=objj_msgSend(_CPTabLabelsView,"class")){
return;
}
var _a6=objj_msgSend(CPBundle,"bundleForClass:",_a4);
_7b=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPThreePartImage,"alloc"),"initWithImageSlices:isVertical:",[objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_a6,"pathForResource:","CPTabView/_CPTabLabelsViewLeft.png"),CGSizeMake(12,26)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_a6,"pathForResource:","CPTabView/_CPTabLabelsViewCenter.png"),CGSizeMake(1,26)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_a6,"pathForResource:","CPTabView/_CPTabLabelsViewRight.png"),CGSizeMake(12,26))],NO));
}
}),new objj_method(sel_getUid("height"),function(_a7,_a8){
with(_a7){
return 26;
}
})]);
var _a9=nil,_aa=nil;
var _c=objj_allocateClassPair(CPView,"_CPTabLabel"),_d=_c.isa;
class_addIvars(_c,[new objj_ivar("_tabViewItem"),new objj_ivar("_labelField")]);
objj_registerClassPair(_c);
class_addMethods(_c,[new objj_method(sel_getUid("initWithFrame:"),function(_ab,_ac,_ad){
with(_ab){
_ab=objj_msgSendSuper({receiver:_ab,super_class:objj_getClass("_CPTabLabel").super_class},"initWithFrame:",_ad);
if(_ab){
_labelField=objj_msgSend(objj_msgSend(CPTextField,"alloc"),"initWithFrame:",CGRectMakeZero());
objj_msgSend(_labelField,"setAlignment:",CPCenterTextAlignment);
objj_msgSend(_labelField,"setFrame:",CGRectMake(5,0,CGRectGetWidth(_ad)-10,20));
objj_msgSend(_labelField,"setAutoresizingMask:",CPViewWidthSizable);
objj_msgSend(_labelField,"setFont:",objj_msgSend(CPFont,"boldSystemFontOfSize:",11));
objj_msgSend(_ab,"addSubview:",_labelField);
objj_msgSend(_ab,"setTabState:",CPBackgroundTab);
}
return _ab;
}
}),new objj_method(sel_getUid("setTabState:"),function(_ae,_af,_b0){
with(_ae){
objj_msgSend(_ae,"setBackgroundColor:",_b0==CPSelectedTab?_aa:_a9);
}
}),new objj_method(sel_getUid("setTabViewItem:"),function(_b1,_b2,_b3){
with(_b1){
_tabViewItem=_b3;
objj_msgSend(_b1,"update");
}
}),new objj_method(sel_getUid("tabViewItem"),function(_b4,_b5){
with(_b4){
return _tabViewItem;
}
}),new objj_method(sel_getUid("update"),function(_b6,_b7){
with(_b6){
objj_msgSend(_labelField,"setStringValue:",objj_msgSend(_tabViewItem,"label"));
}
})]);
class_addMethods(_d,[new objj_method(sel_getUid("initialize"),function(_b8,_b9){
with(_b8){
if(_b8!=objj_msgSend(_CPTabLabel,"class")){
return;
}
var _ba=objj_msgSend(CPBundle,"bundleForClass:",_b8);
_a9=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPThreePartImage,"alloc"),"initWithImageSlices:isVertical:",[objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_ba,"pathForResource:","CPTabView/_CPTabLabelBackgroundLeft.png"),CGSizeMake(6,18)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_ba,"pathForResource:","CPTabView/_CPTabLabelBackgroundCenter.png"),CGSizeMake(1,18)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_ba,"pathForResource:","CPTabView/_CPTabLabelBackgroundRight.png"),CGSizeMake(6,18))],NO));
_aa=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPThreePartImage,"alloc"),"initWithImageSlices:isVertical:",[objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_ba,"pathForResource:","CPTabView/_CPTabLabelSelectedLeft.png"),CGSizeMake(3,18)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_ba,"pathForResource:","CPTabView/_CPTabLabelSelectedCenter.png"),CGSizeMake(1,18)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_ba,"pathForResource:","CPTabView/_CPTabLabelSelectedRight.png"),CGSizeMake(3,18))],NO));
}
})]);
p;15;CPTabViewItem.jt;2872;@STATIC;1.0;I;21;Foundation/CPObject.jI;15;AppKit/CPView.jt;2807;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("AppKit/CPView.j",NO);
CPSelectedTab=0;
CPBackgroundTab=1;
CPPressedTab=2;
var _1=objj_allocateClassPair(CPObject,"CPTabViewItem"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_identifier"),new objj_ivar("_label"),new objj_ivar("_view"),new objj_ivar("_auxiliaryView"),new objj_ivar("_tabView")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("init"),function(_3,_4){
with(_3){
return objj_msgSend(_3,"initWithIdentifier:","");
}
}),new objj_method(sel_getUid("initWithIdentifier:"),function(_5,_6,_7){
with(_5){
_5=objj_msgSendSuper({receiver:_5,super_class:objj_getClass("CPTabViewItem").super_class},"init");
if(_5){
_identifier=_7;
}
return _5;
}
}),new objj_method(sel_getUid("setLabel:"),function(_8,_9,_a){
with(_8){
_label=_a;
}
}),new objj_method(sel_getUid("label"),function(_b,_c){
with(_b){
return _label;
}
}),new objj_method(sel_getUid("tabState"),function(_d,_e){
with(_d){
return _tabState;
}
}),new objj_method(sel_getUid("setIdentifier:"),function(_f,_10,_11){
with(_f){
_identifier=_11;
}
}),new objj_method(sel_getUid("identifier"),function(_12,_13){
with(_12){
return _identifier;
}
}),new objj_method(sel_getUid("setView:"),function(_14,_15,_16){
with(_14){
_view=_16;
}
}),new objj_method(sel_getUid("view"),function(_17,_18){
with(_17){
return _view;
}
}),new objj_method(sel_getUid("setAuxiliaryView:"),function(_19,_1a,_1b){
with(_19){
_auxiliaryView=_1b;
}
}),new objj_method(sel_getUid("auxiliaryView"),function(_1c,_1d){
with(_1c){
return _auxiliaryView;
}
}),new objj_method(sel_getUid("tabView"),function(_1e,_1f){
with(_1e){
return _tabView;
}
}),new objj_method(sel_getUid("_setTabView:"),function(_20,_21,_22){
with(_20){
_tabView=_22;
}
})]);
var _23="CPTabViewItemIdentifierKey",_24="CPTabViewItemLabelKey",_25="CPTabViewItemViewKey",_26="CPTabViewItemAuxViewKey";
var _1=objj_getClass("CPTabViewItem");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPTabViewItem\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_27,_28,_29){
with(_27){
_27=objj_msgSendSuper({receiver:_27,super_class:objj_getClass("CPTabViewItem").super_class},"init");
if(_27){
_identifier=objj_msgSend(_29,"decodeObjectForKey:",_23);
_label=objj_msgSend(_29,"decodeObjectForKey:",_24);
_view=objj_msgSend(_29,"decodeObjectForKey:",_25);
_auxiliaryView=objj_msgSend(_29,"decodeObjectForKey:",_26);
}
return _27;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_2a,_2b,_2c){
with(_2a){
objj_msgSend(_2c,"encodeObject:forKey:",_identifier,_23);
objj_msgSend(_2c,"encodeObject:forKey:",_label,_24);
objj_msgSend(_2c,"encodeObject:forKey:",_view,_25);
objj_msgSend(_2c,"encodeObject:forKey:",_auxiliaryView,_26);
}
})]);
p;13;CPTextField.jt;27290;@STATIC;1.0;i;11;CPControl.ji;17;CPStringDrawing.ji;17;CPCompatibility.ji;21;_CPImageAndTextView.jt;27184;
objj_executeFile("CPControl.j",YES);
objj_executeFile("CPStringDrawing.j",YES);
objj_executeFile("CPCompatibility.j",YES);
objj_executeFile("_CPImageAndTextView.j",YES);
CPTextFieldSquareBezel=0;
CPTextFieldRoundedBezel=1;
CPTextFieldDidFocusNotification="CPTextFieldDidFocusNotification";
CPTextFieldDidBlurNotification="CPTextFieldDidBlurNotification";
var _1=nil,_2=nil,_3=nil,_4=nil,_5=nil,_6=NO,_7=NO,_8=NO,_9=nil,_a=nil,_b=nil;
var _c="•";
var _d=objj_getClass("CPString");
if(!_d){
throw new SyntaxError("*** Could not find definition for class \"CPString\"");
}
var _e=_d.isa;
class_addMethods(_d,[new objj_method(sel_getUid("string"),function(_f,_10){
with(_f){
return _f;
}
})]);
CPTextFieldStateRounded=CPThemeState("rounded");
CPTextFieldStatePlaceholder=CPThemeState("placeholder");
var _d=objj_allocateClassPair(CPControl,"CPTextField"),_e=_d.isa;
class_addIvars(_d,[new objj_ivar("_isEditing"),new objj_ivar("_isEditable"),new objj_ivar("_isSelectable"),new objj_ivar("_isSecure"),new objj_ivar("_drawsBackground"),new objj_ivar("_textFieldBackgroundColor"),new objj_ivar("_placeholderString"),new objj_ivar("_delegate"),new objj_ivar("_textDidChangeValue"),new objj_ivar("_bezelStyle"),new objj_ivar("_isBordered"),new objj_ivar("_controlSize")]);
objj_registerClassPair(_d);
class_addMethods(_d,[new objj_method(sel_getUid("_inputElement"),function(_11,_12){
with(_11){
if(!_1){
_1=document.createElement("input");
_1.style.position="absolute";
_1.style.border="0px";
_1.style.padding="0px";
_1.style.margin="0px";
_1.style.whiteSpace="pre";
_1.style.background="transparent";
_1.style.outline="none";
_b=function(_13){
if(_4&&_4._DOMElement!=_1.parentNode){
return;
}
if(!_6){
objj_msgSend(objj_msgSend(_4,"window"),"makeFirstResponder:",nil);
return;
}
CPTextFieldHandleBlur(_13,_1);
_7=YES;
return true;
};
CPTextFieldHandleBlur=function(_14){
_4=nil;
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
};
_1.onblur=_b;
_3=_1;
}
if(CPFeatureIsCompatible(CPInputTypeCanBeChangedFeature)){
if(objj_msgSend(_11,"isSecure")){
_1.type="password";
}else{
_1.type="text";
}
return _1;
}
if(objj_msgSend(_11,"isSecure")){
if(!_2){
_2=document.createElement("input");
_2.style.position="absolute";
_2.style.border="0px";
_2.style.padding="0px";
_2.style.margin="0px";
_2.style.whiteSpace="pre";
_2.style.background="transparent";
_2.style.outline="none";
_2.type="password";
_2.onblur=_b;
}
_1=_2;
}else{
_1=_3;
}
return _1;
}
}),new objj_method(sel_getUid("initWithFrame:"),function(_15,_16,_17){
with(_15){
_15=objj_msgSendSuper({receiver:_15,super_class:objj_getClass("CPTextField").super_class},"initWithFrame:",_17);
if(_15){
objj_msgSend(_15,"setStringValue:","");
objj_msgSend(_15,"setPlaceholderString:","");
_sendActionOn=CPKeyUpMask|CPKeyDownMask;
objj_msgSend(_15,"setValue:forThemeAttribute:",CPLeftTextAlignment,"alignment");
}
return _15;
}
}),new objj_method(sel_getUid("setEditable:"),function(_18,_19,_1a){
with(_18){
_isEditable=_1a;
}
}),new objj_method(sel_getUid("isEditable"),function(_1b,_1c){
with(_1b){
return _isEditable;
}
}),new objj_method(sel_getUid("setSelectable:"),function(_1d,_1e,_1f){
with(_1d){
_isSelectable=_1f;
}
}),new objj_method(sel_getUid("isSelectable"),function(_20,_21){
with(_20){
return _isSelectable;
}
}),new objj_method(sel_getUid("setSecure:"),function(_22,_23,_24){
with(_22){
_isSecure=_24;
}
}),new objj_method(sel_getUid("isSecure"),function(_25,_26){
with(_25){
return _isSecure;
}
}),new objj_method(sel_getUid("setBezeled:"),function(_27,_28,_29){
with(_27){
if(_29){
objj_msgSend(_27,"setThemeState:",CPThemeStateBezeled);
}else{
objj_msgSend(_27,"unsetThemeState:",CPThemeStateBezeled);
}
}
}),new objj_method(sel_getUid("isBezeled"),function(_2a,_2b){
with(_2a){
return objj_msgSend(_2a,"hasThemeState:",CPThemeStateBezeled);
}
}),new objj_method(sel_getUid("setBezelStyle:"),function(_2c,_2d,_2e){
with(_2c){
var _2f=_2e===CPTextFieldRoundedBezel;
if(_2f){
objj_msgSend(_2c,"setThemeState:",CPTextFieldStateRounded);
}else{
objj_msgSend(_2c,"unsetThemeState:",CPTextFieldStateRounded);
}
}
}),new objj_method(sel_getUid("bezelStyle"),function(_30,_31){
with(_30){
if(objj_msgSend(_30,"hasThemeState:",CPTextFieldStateRounded)){
return CPTextFieldRoundedBezel;
}
return CPTextFieldSquareBezel;
}
}),new objj_method(sel_getUid("setBordered:"),function(_32,_33,_34){
with(_32){
if(_34){
objj_msgSend(_32,"setThemeState:",CPThemeStateBordered);
}else{
objj_msgSend(_32,"unsetThemeState:",CPThemeStateBordered);
}
}
}),new objj_method(sel_getUid("isBordered"),function(_35,_36){
with(_35){
return objj_msgSend(_35,"hasThemeState:",CPThemeStateBordered);
}
}),new objj_method(sel_getUid("setDrawsBackground:"),function(_37,_38,_39){
with(_37){
if(_drawsBackground==_39){
return;
}
_drawsBackground=_39;
objj_msgSend(_37,"setNeedsLayout");
objj_msgSend(_37,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("drawsBackground"),function(_3a,_3b){
with(_3a){
return _drawsBackground;
}
}),new objj_method(sel_getUid("setTextFieldBackgroundColor:"),function(_3c,_3d,_3e){
with(_3c){
if(_textFieldBackgroundColor==_3e){
return;
}
_textFieldBackgroundColor=_3e;
objj_msgSend(_3c,"setNeedsLayout");
objj_msgSend(_3c,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("textFieldBackgroundColor"),function(_3f,_40){
with(_3f){
return _textFieldBackgroundColor;
}
}),new objj_method(sel_getUid("acceptsFirstResponder"),function(_41,_42){
with(_41){
return objj_msgSend(_41,"isEditable")&&objj_msgSend(_41,"isEnabled");
}
}),new objj_method(sel_getUid("becomeFirstResponder"),function(_43,_44){
with(_43){
if(_4&&objj_msgSend(_4,"window")!==objj_msgSend(_43,"window")){
objj_msgSend(objj_msgSend(_4,"window"),"makeFirstResponder:",nil);
}
objj_msgSend(_43,"setThemeState:",CPThemeStateEditing);
objj_msgSend(_43,"_updatePlaceholderState");
objj_msgSend(_43,"setNeedsLayout");
_isEditing=NO;
var _45=objj_msgSend(_43,"stringValue"),_46=objj_msgSend(_43,"_inputElement");
_46.value=_45;
_46.style.color=objj_msgSend(objj_msgSend(_43,"currentValueForThemeAttribute:","text-color"),"cssString");
_46.style.font=objj_msgSend(objj_msgSend(_43,"currentValueForThemeAttribute:","font"),"cssString");
_46.style.zIndex=1000;
switch(objj_msgSend(_43,"alignment")){
case CPCenterTextAlignment:
_46.style.textAlign="center";
break;
case CPRightTextAlignment:
_46.style.textAlign="right";
break;
default:
_46.style.textAlign="left";
}
var _47=objj_msgSend(_43,"contentRectForBounds:",objj_msgSend(_43,"bounds"));
_46.style.top=(_47.origin.y)+"px";
_46.style.left=((_47.origin.x)-1)+"px";
_46.style.width=(_47.size.width)+"px";
_46.style.height=(_47.size.height)+"px";
_DOMElement.appendChild(_46);
window.setTimeout(function(){
_46.focus();
objj_msgSend(_43,"textDidFocus:",objj_msgSend(CPNotification,"notificationWithName:object:userInfo:",CPTextFieldDidFocusNotification,_43,nil));
_4=_43;
},0);
_46.value=objj_msgSend(_43,"stringValue");
objj_msgSend(objj_msgSend(objj_msgSend(_43,"window"),"platformWindow"),"_propagateCurrentDOMEvent:",YES);
_8=YES;
if(document.attachEvent){
_9=objj_msgSend(objj_msgSend(_43,"window"),"platformWindow")._DOMBodyElement.onselectstart;
_a=objj_msgSend(objj_msgSend(_43,"window"),"platformWindow")._DOMBodyElement.ondrag;
objj_msgSend(objj_msgSend(_43,"window"),"platformWindow")._DOMBodyElement.ondrag=function(){
};
objj_msgSend(objj_msgSend(_43,"window"),"platformWindow")._DOMBodyElement.onselectstart=function(){
};
}
return YES;
}
}),new objj_method(sel_getUid("resignFirstResponder"),function(_48,_49){
with(_48){
objj_msgSend(_48,"unsetThemeState:",CPThemeStateEditing);
objj_msgSend(_48,"_updatePlaceholderState");
objj_msgSend(_48,"setNeedsLayout");
var _4a=objj_msgSend(_48,"_inputElement");
objj_msgSend(_48,"setObjectValue:",_4a.value);
_6=YES;
_4a.blur();
if(!_7){
_b();
}
_7=NO;
_6=NO;
if(_4a.parentNode==_DOMElement){
_4a.parentNode.removeChild(_4a);
}
_8=NO;
if(document.attachEvent){
_9=nil;
_a=nil;
objj_msgSend(objj_msgSend(_48,"window"),"platformWindow")._DOMBodyElement.ondrag=_a;
objj_msgSend(objj_msgSend(_48,"window"),"platformWindow")._DOMBodyElement.onselectstart=_9;
}
if(_isEditing){
_isEditing=NO;
objj_msgSend(_48,"textDidEndEditing:",objj_msgSend(CPNotification,"notificationWithName:object:userInfo:",CPControlTextDidEndEditingNotification,_48,nil));
if(objj_msgSend(_48,"sendsActionOnEndEditing")){
objj_msgSend(_48,"sendAction:to:",objj_msgSend(_48,"action"),objj_msgSend(_48,"target"));
}
}
objj_msgSend(_48,"textDidBlur:",objj_msgSend(CPNotification,"notificationWithName:object:userInfo:",CPTextFieldDidBlurNotification,_48,nil));
return YES;
}
}),new objj_method(sel_getUid("needsPanelToBecomeKey"),function(_4b,_4c){
with(_4b){
return YES;
}
}),new objj_method(sel_getUid("mouseDown:"),function(_4d,_4e,_4f){
with(_4d){
if(objj_msgSend(_4d,"isEditable")&&objj_msgSend(_4d,"isEnabled")){
return objj_msgSend(objj_msgSend(_4d,"window"),"makeFirstResponder:",_4d);
}else{
return objj_msgSend(objj_msgSend(_4d,"nextResponder"),"mouseDown:",_4f);
}
}
}),new objj_method(sel_getUid("mouseUp:"),function(_50,_51,_52){
with(_50){
if(!objj_msgSend(_50,"isEditable")||!objj_msgSend(_50,"isEnabled")){
objj_msgSend(objj_msgSend(_50,"nextResponder"),"mouseUp:",_52);
}
}
}),new objj_method(sel_getUid("mouseDragged:"),function(_53,_54,_55){
with(_53){
if(!objj_msgSend(_53,"isEditable")||!objj_msgSend(_53,"isEnabled")){
objj_msgSend(objj_msgSend(_53,"nextResponder"),"mouseDragged:",_55);
}
}
}),new objj_method(sel_getUid("keyUp:"),function(_56,_57,_58){
with(_56){
var _59=objj_msgSend(_56,"stringValue");
objj_msgSend(_56,"_setStringValue:",objj_msgSend(_56,"_inputElement").value);
if(_59!==objj_msgSend(_56,"stringValue")){
if(!_isEditing){
_isEditing=YES;
objj_msgSend(_56,"textDidBeginEditing:",objj_msgSend(CPNotification,"notificationWithName:object:userInfo:",CPControlTextDidBeginEditingNotification,_56,nil));
}
objj_msgSend(_56,"textDidChange:",objj_msgSend(CPNotification,"notificationWithName:object:userInfo:",CPControlTextDidChangeNotification,_56,nil));
}
objj_msgSend(objj_msgSend(objj_msgSend(_56,"window"),"platformWindow"),"_propagateCurrentDOMEvent:",YES);
}
}),new objj_method(sel_getUid("keyDown:"),function(_5a,_5b,_5c){
with(_5a){
if(objj_msgSend(_5c,"keyCode")===CPReturnKeyCode){
if(_isEditing){
_isEditing=NO;
objj_msgSend(_5a,"textDidEndEditing:",objj_msgSend(CPNotification,"notificationWithName:object:userInfo:",CPControlTextDidEndEditingNotification,_5a,nil));
}
objj_msgSend(_5a,"sendAction:to:",objj_msgSend(_5a,"action"),objj_msgSend(_5a,"target"));
objj_msgSend(_5a,"selectText:",nil);
objj_msgSend(objj_msgSend(objj_msgSend(_5a,"window"),"platformWindow"),"_propagateCurrentDOMEvent:",NO);
}else{
if(objj_msgSend(_5c,"keyCode")===CPTabKeyCode){
if(objj_msgSend(_5c,"modifierFlags")&CPShiftKeyMask){
objj_msgSend(objj_msgSend(_5a,"window"),"selectPreviousKeyView:",_5a);
}else{
objj_msgSend(objj_msgSend(_5a,"window"),"selectNextKeyView:",_5a);
}
if(objj_msgSend(objj_msgSend(objj_msgSend(_5a,"window"),"firstResponder"),"respondsToSelector:",sel_getUid("selectText:"))){
objj_msgSend(objj_msgSend(objj_msgSend(_5a,"window"),"firstResponder"),"selectText:",_5a);
}
objj_msgSend(objj_msgSend(objj_msgSend(_5a,"window"),"platformWindow"),"_propagateCurrentDOMEvent:",NO);
}else{
objj_msgSend(objj_msgSend(objj_msgSend(_5a,"window"),"platformWindow"),"_propagateCurrentDOMEvent:",YES);
}
}
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
}
}),new objj_method(sel_getUid("textDidBlur:"),function(_5d,_5e,_5f){
with(_5d){
if(objj_msgSend(_5f,"object")!=_5d){
return;
}
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotification:",_5f);
}
}),new objj_method(sel_getUid("textDidFocus:"),function(_60,_61,_62){
with(_60){
if(objj_msgSend(_62,"object")!=_60){
return;
}
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotification:",_62);
}
}),new objj_method(sel_getUid("objectValue"),function(_63,_64){
with(_63){
return objj_msgSendSuper({receiver:_63,super_class:objj_getClass("CPTextField").super_class},"objectValue");
}
}),new objj_method(sel_getUid("_setStringValue:"),function(_65,_66,_67){
with(_65){
objj_msgSend(_65,"willChangeValueForKey:","objectValue");
objj_msgSendSuper({receiver:_65,super_class:objj_getClass("CPTextField").super_class},"setObjectValue:",String(_67));
objj_msgSend(_65,"_updatePlaceholderState");
objj_msgSend(_65,"didChangeValueForKey:","objectValue");
}
}),new objj_method(sel_getUid("setObjectValue:"),function(_68,_69,_6a){
with(_68){
objj_msgSendSuper({receiver:_68,super_class:objj_getClass("CPTextField").super_class},"setObjectValue:",_6a);
if(_4===_68||objj_msgSend(objj_msgSend(_68,"window"),"firstResponder")===_68){
objj_msgSend(_68,"_inputElement").value=_6a;
}
objj_msgSend(_68,"_updatePlaceholderState");
}
}),new objj_method(sel_getUid("_updatePlaceholderState"),function(_6b,_6c){
with(_6b){
var _6d=objj_msgSend(_6b,"stringValue");
if((!_6d||_6d.length===0)&&!objj_msgSend(_6b,"hasThemeState:",CPThemeStateEditing)){
objj_msgSend(_6b,"setThemeState:",CPTextFieldStatePlaceholder);
}else{
objj_msgSend(_6b,"unsetThemeState:",CPTextFieldStatePlaceholder);
}
}
}),new objj_method(sel_getUid("setPlaceholderString:"),function(_6e,_6f,_70){
with(_6e){
if(_placeholderString===_70){
return;
}
_placeholderString=_70;
if(objj_msgSend(_6e,"hasThemeState:",CPTextFieldStatePlaceholder)){
objj_msgSend(_6e,"setNeedsLayout");
objj_msgSend(_6e,"setNeedsDisplay:",YES);
}
}
}),new objj_method(sel_getUid("placeholderString"),function(_71,_72){
with(_71){
return _placeholderString;
}
}),new objj_method(sel_getUid("sizeToFit"),function(_73,_74){
with(_73){
var _75=objj_msgSend((objj_msgSend(_73,"stringValue")||" "),"sizeWithFont:",objj_msgSend(_73,"currentValueForThemeAttribute:","font")),_76=objj_msgSend(_73,"currentValueForThemeAttribute:","content-inset"),_77=objj_msgSend(_73,"currentValueForThemeAttribute:","min-size"),_78=objj_msgSend(_73,"currentValueForThemeAttribute:","max-size");
_75.width=MAX(_75.width+_76.left+_76.right,_77.width);
_75.height=MAX(_75.height+_76.top+_76.bottom,_77.height);
if(_78.width>=0){
_75.width=MIN(_75.width,_78.width);
}
if(_78.height>=0){
_75.height=MIN(_75.height,_78.height);
}
if(objj_msgSend(_73,"isEditable")){
_75.width=CGRectGetWidth(objj_msgSend(_73,"frame"));
}
objj_msgSend(_73,"setFrameSize:",_75);
}
}),new objj_method(sel_getUid("selectText:"),function(_79,_7a,_7b){
with(_79){
var _7c=objj_msgSend(_79,"_inputElement");
if((objj_msgSend(_79,"isEditable")||objj_msgSend(_79,"isSelectable"))){
if(objj_msgSend(objj_msgSend(_79,"window"),"firstResponder")===_79){
window.setTimeout(function(){
_7c.select();
},0);
}else{
objj_msgSend(objj_msgSend(_79,"window"),"makeFirstResponder:",_79);
window.setTimeout(function(){
objj_msgSend(_79,"selectText:",_7b);
},0);
}
}
}
}),new objj_method(sel_getUid("copy:"),function(_7d,_7e,_7f){
with(_7d){
if(!objj_msgSend(CPPlatform,"isBrowser")){
var _80=objj_msgSend(_7d,"selectedRange");
if(_80.length<1){
return;
}
var _81=objj_msgSend(CPPasteboard,"generalPasteboard"),_82=objj_msgSend(_7d,"stringValue"),_83=objj_msgSend(_82,"substringWithRange:",_80);
objj_msgSend(_81,"declareTypes:owner:",[CPStringPboardType],nil);
objj_msgSend(_81,"setString:forType:",_83,CPStringPboardType);
}
}
}),new objj_method(sel_getUid("cut:"),function(_84,_85,_86){
with(_84){
if(!objj_msgSend(CPPlatform,"isBrowser")){
objj_msgSend(_84,"copy:",_86);
objj_msgSend(_84,"deleteBackward:",_86);
}
}
}),new objj_method(sel_getUid("paste:"),function(_87,_88,_89){
with(_87){
if(!objj_msgSend(CPPlatform,"isBrowser")){
var _8a=objj_msgSend(CPPasteboard,"generalPasteboard");
if(!objj_msgSend(objj_msgSend(_8a,"types"),"containsObject:",CPStringPboardType)){
return;
}
objj_msgSend(_87,"deleteBackward:",_89);
var _8b=objj_msgSend(_87,"selectedRange"),_8c=objj_msgSend(_87,"stringValue"),_8d=objj_msgSend(_8a,"stringForType:",CPStringPboardType),_8e=objj_msgSend(_8c,"stringByReplacingCharactersInRange:withString:",_8b,_8d);
objj_msgSend(_87,"setStringValue:",_8e);
objj_msgSend(_87,"setSelectedRange:",CPMakeRange(_8b.location+_8d.length,0));
}
}
}),new objj_method(sel_getUid("selectedRange"),function(_8f,_90){
with(_8f){
if(objj_msgSend(objj_msgSend(_8f,"window"),"firstResponder")!==_8f){
return CPMakeRange(0,0);
}
try{
var _91=objj_msgSend(_8f,"_inputElement"),_92=_91.selectionStart,_93=_91.selectionEnd;
if(objj_msgSend(_92,"isKindOfClass:",CPNumber)){
return CPMakeRange(_92,_93-_92);
}
var _94=_91.ownerDocument||_91.document,_95=_94.selection.createRange(),_96=_91.createTextRange();
if(_96.inRange(_95)){
_96.setEndPoint("EndToStart",_95);
return CPMakeRange(_96.text.length,_95.text.length);
}
}
catch(e){
}
return CGMakeRange(0,0);
}
}),new objj_method(sel_getUid("setSelectedRange:"),function(_97,_98,_99){
with(_97){
if(!objj_msgSend(objj_msgSend(_97,"window"),"firstResponder")===_97){
return;
}
var _9a=objj_msgSend(_97,"_inputElement");
try{
if(objj_msgSend(_9a.selectionStart,"isKindOfClass:",CPNumber)){
_9a.selectionStart=_99.location;
_9a.selectionEnd=CPMaxRange(_99);
}else{
var _9b=_9a.ownerDocument||_9a.document,_9c=_9b.selection.createRange(),_9d=_9a.createTextRange();
if(_9d.inRange(_9c)){
_9d.collapse(true);
_9d.move("character",_99.location);
_9d.moveEnd("character",_99.length);
_9d.select();
}
}
}
catch(e){
}
}
}),new objj_method(sel_getUid("selectAll:"),function(_9e,_9f,_a0){
with(_9e){
objj_msgSend(_9e,"selectText:",_a0);
}
}),new objj_method(sel_getUid("deleteBackward:"),function(_a1,_a2,_a3){
with(_a1){
var _a4=objj_msgSend(_a1,"selectedRange"),_a5=objj_msgSend(_a1,"stringValue"),_a6=objj_msgSend(_a5,"stringByReplacingCharactersInRange:withString:",_a4,"");
objj_msgSend(_a1,"setStringValue:",_a6);
objj_msgSend(_a1,"setSelectedRange:",CPMakeRange(_a4.location,0));
}
}),new objj_method(sel_getUid("setDelegate:"),function(_a7,_a8,_a9){
with(_a7){
var _aa=objj_msgSend(CPNotificationCenter,"defaultCenter");
if(_delegate){
objj_msgSend(_aa,"removeObserver:name:object:",_delegate,CPControlTextDidBeginEditingNotification,_a7);
objj_msgSend(_aa,"removeObserver:name:object:",_delegate,CPControlTextDidChangeNotification,_a7);
objj_msgSend(_aa,"removeObserver:name:object:",_delegate,CPControlTextDidEndEditingNotification,_a7);
objj_msgSend(_aa,"removeObserver:name:object:",_delegate,CPTextFieldDidFocusNotification,_a7);
objj_msgSend(_aa,"removeObserver:name:object:",_delegate,CPTextFieldDidBlurNotification,_a7);
}
_delegate=_a9;
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("controlTextDidBeginEditing:"))){
objj_msgSend(_aa,"addObserver:selector:name:object:",_delegate,sel_getUid("controlTextDidBeginEditing:"),CPControlTextDidBeginEditingNotification,_a7);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("controlTextDidChange:"))){
objj_msgSend(_aa,"addObserver:selector:name:object:",_delegate,sel_getUid("controlTextDidChange:"),CPControlTextDidChangeNotification,_a7);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("controlTextDidEndEditing:"))){
objj_msgSend(_aa,"addObserver:selector:name:object:",_delegate,sel_getUid("controlTextDidEndEditing:"),CPControlTextDidEndEditingNotification,_a7);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("controlTextDidFocus:"))){
objj_msgSend(_aa,"addObserver:selector:name:object:",_delegate,sel_getUid("controlTextDidFocus:"),CPTextFieldDidFocusNotification,_a7);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("controlTextDidBlur:"))){
objj_msgSend(_aa,"addObserver:selector:name:object:",_delegate,sel_getUid("controlTextDidBlur:"),CPTextFieldDidBlurNotification,_a7);
}
}
}),new objj_method(sel_getUid("delegate"),function(_ab,_ac){
with(_ab){
return _delegate;
}
}),new objj_method(sel_getUid("contentRectForBounds:"),function(_ad,_ae,_af){
with(_ad){
var _b0=objj_msgSend(_ad,"currentValueForThemeAttribute:","content-inset");
if(!_b0){
return _af;
}
_af.origin.x+=_b0.left;
_af.origin.y+=_b0.top;
_af.size.width-=_b0.left+_b0.right;
_af.size.height-=_b0.top+_b0.bottom;
return _af;
}
}),new objj_method(sel_getUid("bezelRectForBounds:"),function(_b1,_b2,_b3){
with(_b1){
var _b4=objj_msgSend(_b1,"currentValueForThemeAttribute:","bezel-inset");
if(((_b4).top===0&&(_b4).right===0&&(_b4).bottom===0&&(_b4).left===0)){
return _b3;
}
_b3.origin.x+=_b4.left;
_b3.origin.y+=_b4.top;
_b3.size.width-=_b4.left+_b4.right;
_b3.size.height-=_b4.top+_b4.bottom;
return _b3;
}
}),new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"),function(_b5,_b6,_b7){
with(_b5){
if(_b7==="bezel-view"){
return objj_msgSend(_b5,"bezelRectForBounds:",objj_msgSend(_b5,"bounds"));
}else{
if(_b7==="content-view"){
return objj_msgSend(_b5,"contentRectForBounds:",objj_msgSend(_b5,"bounds"));
}
}
return objj_msgSendSuper({receiver:_b5,super_class:objj_getClass("CPTextField").super_class},"rectForEphemeralSubviewNamed:",_b7);
}
}),new objj_method(sel_getUid("createEphemeralSubviewNamed:"),function(_b8,_b9,_ba){
with(_b8){
if(_ba==="bezel-view"){
var _bb=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",{origin:{x:0,y:0},size:{width:0,height:0}});
objj_msgSend(_bb,"setHitTests:",NO);
return _bb;
}else{
var _bb=objj_msgSend(objj_msgSend(_CPImageAndTextView,"alloc"),"initWithFrame:",{origin:{x:0,y:0},size:{width:0,height:0}});
objj_msgSend(_bb,"setHitTests:",NO);
return _bb;
}
return objj_msgSendSuper({receiver:_b8,super_class:objj_getClass("CPTextField").super_class},"createEphemeralSubviewNamed:",_ba);
}
}),new objj_method(sel_getUid("layoutSubviews"),function(_bc,_bd){
with(_bc){
var _be=objj_msgSend(_bc,"layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:","bezel-view",CPWindowBelow,"content-view");
if(_be){
objj_msgSend(_be,"setBackgroundColor:",objj_msgSend(_bc,"currentValueForThemeAttribute:","bezel-color"));
}
var _bf=objj_msgSend(_bc,"layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:","content-view",CPWindowAbove,"bezel-view");
if(_bf){
objj_msgSend(_bf,"setHidden:",objj_msgSend(_bc,"hasThemeState:",CPThemeStateEditing));
var _c0="";
if(objj_msgSend(_bc,"hasThemeState:",CPTextFieldStatePlaceholder)){
_c0=objj_msgSend(_bc,"placeholderString");
}else{
_c0=objj_msgSend(_bc,"stringValue");
if(objj_msgSend(_bc,"isSecure")){
_c0=_c1(_c0);
}
}
objj_msgSend(_bf,"setText:",_c0);
objj_msgSend(_bf,"setTextColor:",objj_msgSend(_bc,"currentValueForThemeAttribute:","text-color"));
objj_msgSend(_bf,"setFont:",objj_msgSend(_bc,"currentValueForThemeAttribute:","font"));
objj_msgSend(_bf,"setAlignment:",objj_msgSend(_bc,"currentValueForThemeAttribute:","alignment"));
objj_msgSend(_bf,"setVerticalAlignment:",objj_msgSend(_bc,"currentValueForThemeAttribute:","vertical-alignment"));
objj_msgSend(_bf,"setLineBreakMode:",objj_msgSend(_bc,"currentValueForThemeAttribute:","line-break-mode"));
objj_msgSend(_bf,"setTextShadowColor:",objj_msgSend(_bc,"currentValueForThemeAttribute:","text-shadow-color"));
objj_msgSend(_bf,"setTextShadowOffset:",objj_msgSend(_bc,"currentValueForThemeAttribute:","text-shadow-offset"));
}
}
})]);
class_addMethods(_e,[new objj_method(sel_getUid("textFieldWithStringValue:placeholder:width:"),function(_c2,_c3,_c4,_c5,_c6){
with(_c2){
return objj_msgSend(_c2,"textFieldWithStringValue:placeholder:width:theme:",_c4,_c5,_c6,objj_msgSend(CPTheme,"defaultTheme"));
}
}),new objj_method(sel_getUid("textFieldWithStringValue:placeholder:width:theme:"),function(_c7,_c8,_c9,_ca,_cb,_cc){
with(_c7){
var _cd=objj_msgSend(objj_msgSend(_c7,"alloc"),"initWithFrame:",CGRectMake(0,0,_cb,29));
objj_msgSend(_cd,"setTheme:",_cc);
objj_msgSend(_cd,"setStringValue:",_c9);
objj_msgSend(_cd,"setPlaceholderString:",_ca);
objj_msgSend(_cd,"setBordered:",YES);
objj_msgSend(_cd,"setBezeled:",YES);
objj_msgSend(_cd,"setEditable:",YES);
objj_msgSend(_cd,"sizeToFit");
return _cd;
}
}),new objj_method(sel_getUid("roundedTextFieldWithStringValue:placeholder:width:"),function(_ce,_cf,_d0,_d1,_d2){
with(_ce){
return objj_msgSend(_ce,"roundedTextFieldWithStringValue:placeholder:width:theme:",_d0,_d1,_d2,objj_msgSend(CPTheme,"defaultTheme"));
}
}),new objj_method(sel_getUid("roundedTextFieldWithStringValue:placeholder:width:theme:"),function(_d3,_d4,_d5,_d6,_d7,_d8){
with(_d3){
var _d9=objj_msgSend(objj_msgSend(CPTextField,"alloc"),"initWithFrame:",CGRectMake(0,0,_d7,29));
objj_msgSend(_d9,"setTheme:",_d8);
objj_msgSend(_d9,"setStringValue:",_d5);
objj_msgSend(_d9,"setPlaceholderString:",_d6);
objj_msgSend(_d9,"setBezelStyle:",CPTextFieldRoundedBezel);
objj_msgSend(_d9,"setBordered:",YES);
objj_msgSend(_d9,"setBezeled:",YES);
objj_msgSend(_d9,"setEditable:",YES);
objj_msgSend(_d9,"sizeToFit");
return _d9;
}
}),new objj_method(sel_getUid("labelWithTitle:"),function(_da,_db,_dc){
with(_da){
return objj_msgSend(_da,"labelWithTitle:theme:",_dc,objj_msgSend(CPTheme,"defaultTheme"));
}
}),new objj_method(sel_getUid("labelWithTitle:theme:"),function(_dd,_de,_df,_e0){
with(_dd){
var _e1=objj_msgSend(objj_msgSend(_dd,"alloc"),"init");
objj_msgSend(_e1,"setStringValue:",_df);
objj_msgSend(_e1,"sizeToFit");
return _e1;
}
}),new objj_method(sel_getUid("themeClass"),function(_e2,_e3){
with(_e2){
return "textfield";
}
}),new objj_method(sel_getUid("themeAttributes"),function(_e4,_e5){
with(_e4){
return objj_msgSend(CPDictionary,"dictionaryWithObjects:forKeys:",[{top:(0),right:(0),bottom:(0),left:(0)},{top:(2),right:(2),bottom:(2),left:(2)},objj_msgSend(CPNull,"null")],["bezel-inset","content-inset","bezel-color"]);
}
})]);
var _c1=function(_e6){
if(!_e6){
return "";
}
return Array(_e6.length+1).join(_c);
};
var _e7="CPTextFieldIsEditableKey",_e8="CPTextFieldIsSelectableKey",_e9="CPTextFieldIsBorderedKey",_ea="CPTextFieldIsBezeledKey",_eb="CPTextFieldBezelStyleKey",_ec="CPTextFieldDrawsBackgroundKey",_ed="CPTextFieldLineBreakModeKey",_ee="CPTextFieldBackgroundColorKey",_ef="CPTextFieldPlaceholderStringKey";
var _d=objj_getClass("CPTextField");
if(!_d){
throw new SyntaxError("*** Could not find definition for class \"CPTextField\"");
}
var _e=_d.isa;
class_addMethods(_d,[new objj_method(sel_getUid("initWithCoder:"),function(_f0,_f1,_f2){
with(_f0){
_f0=objj_msgSendSuper({receiver:_f0,super_class:objj_getClass("CPTextField").super_class},"initWithCoder:",_f2);
if(_f0){
objj_msgSend(_f0,"setEditable:",objj_msgSend(_f2,"decodeBoolForKey:",_e7));
objj_msgSend(_f0,"setSelectable:",objj_msgSend(_f2,"decodeBoolForKey:",_e8));
objj_msgSend(_f0,"setDrawsBackground:",objj_msgSend(_f2,"decodeBoolForKey:",_ec));
objj_msgSend(_f0,"setTextFieldBackgroundColor:",objj_msgSend(_f2,"decodeObjectForKey:",_ee));
objj_msgSend(_f0,"setPlaceholderString:",objj_msgSend(_f2,"decodeObjectForKey:",_ef));
}
return _f0;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_f3,_f4,_f5){
with(_f3){
objj_msgSendSuper({receiver:_f3,super_class:objj_getClass("CPTextField").super_class},"encodeWithCoder:",_f5);
objj_msgSend(_f5,"encodeBool:forKey:",_isEditable,_e7);
objj_msgSend(_f5,"encodeBool:forKey:",_isSelectable,_e8);
objj_msgSend(_f5,"encodeBool:forKey:",_drawsBackground,_ec);
objj_msgSend(_f5,"encodeObject:forKey:",_textFieldBackgroundColor,_ee);
objj_msgSend(_f5,"encodeObject:forKey:",_placeholderString,_ef);
}
})]);
p;9;CPTheme.jt;10900;@STATIC;1.0;I;21;Foundation/CPObject.jI;21;Foundation/CPString.jI;30;Foundation/CPKeyedUnarchiver.jt;10793;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("Foundation/CPKeyedUnarchiver.j",NO);
var _1={},_2=nil;
var _3=objj_allocateClassPair(CPObject,"CPTheme"),_4=_3.isa;
class_addIvars(_3,[new objj_ivar("_name"),new objj_ivar("_attributes")]);
objj_registerClassPair(_3);
class_addMethods(_3,[new objj_method(sel_getUid("initWithName:"),function(_5,_6,_7){
with(_5){
_5=objj_msgSendSuper({receiver:_5,super_class:objj_getClass("CPTheme").super_class},"init");
if(_5){
_name=_7;
_attributes=objj_msgSend(CPDictionary,"dictionary");
_1[_name]=_5;
}
return _5;
}
}),new objj_method(sel_getUid("name"),function(_8,_9){
with(_8){
return _name;
}
}),new objj_method(sel_getUid("_attributeWithName:forClass:"),function(_a,_b,_c,_d){
with(_a){
var _e=objj_msgSend(_attributes,"objectForKey:",_d);
if(!_e){
return nil;
}
return objj_msgSend(_e,"objectForKey:",_c);
}
}),new objj_method(sel_getUid("takeThemeFromObject:"),function(_f,_10,_11){
with(_f){
var _12=objj_msgSend(_11,"_themeAttributeDictionary"),_13=nil,_14=objj_msgSend(_12,"keyEnumerator"),_15=objj_msgSend(objj_msgSend(_11,"class"),"themeClass");
while(_13=objj_msgSend(_14,"nextObject")){
objj_msgSend(_f,"_recordAttribute:forClass:",objj_msgSend(_12,"objectForKey:",_13),_15);
}
}
}),new objj_method(sel_getUid("_recordAttribute:forClass:"),function(_16,_17,_18,_19){
with(_16){
if(!objj_msgSend(_18,"hasValues")){
return;
}
var _1a=objj_msgSend(_attributes,"objectForKey:",_19);
if(!_1a){
_1a=objj_msgSend(CPDictionary,"dictionary");
objj_msgSend(_attributes,"setObject:forKey:",_1a,_19);
}
var _1b=objj_msgSend(_18,"name"),_1c=objj_msgSend(_1a,"objectForKey:",_1b);
if(_1c){
objj_msgSend(_1a,"setObject:forKey:",objj_msgSend(_1c,"attributeMergedWithAttribute:",_18),_1b);
}else{
objj_msgSend(_1a,"setObject:forKey:",_18,_1b);
}
}
})]);
class_addMethods(_4,[new objj_method(sel_getUid("setDefaultTheme:"),function(_1d,_1e,_1f){
with(_1d){
_2=_1f;
}
}),new objj_method(sel_getUid("defaultTheme"),function(_20,_21){
with(_20){
return _2;
}
}),new objj_method(sel_getUid("themeNamed:"),function(_22,_23,_24){
with(_22){
return _1[_24];
}
})]);
var _25="CPThemeNameKey",_26="CPThemeAttributesKey";
var _3=objj_getClass("CPTheme");
if(!_3){
throw new SyntaxError("*** Could not find definition for class \"CPTheme\"");
}
var _4=_3.isa;
class_addMethods(_3,[new objj_method(sel_getUid("initWithCoder:"),function(_27,_28,_29){
with(_27){
_27=objj_msgSendSuper({receiver:_27,super_class:objj_getClass("CPTheme").super_class},"init");
if(_27){
_name=objj_msgSend(_29,"decodeObjectForKey:",_25);
_attributes=objj_msgSend(_29,"decodeObjectForKey:",_26);
_1[_name]=_27;
}
return _27;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_2a,_2b,_2c){
with(_2a){
objj_msgSend(_2c,"encodeObject:forKey:",_name,_25);
objj_msgSend(_2c,"encodeObject:forKey:",_attributes,_26);
}
})]);
var _3=objj_allocateClassPair(CPKeyedUnarchiver,"_CPThemeKeyedUnarchiver"),_4=_3.isa;
class_addIvars(_3,[new objj_ivar("_bundle")]);
objj_registerClassPair(_3);
class_addMethods(_3,[new objj_method(sel_getUid("initForReadingWithData:bundle:"),function(_2d,_2e,_2f,_30){
with(_2d){
_2d=objj_msgSendSuper({receiver:_2d,super_class:objj_getClass("_CPThemeKeyedUnarchiver").super_class},"initForReadingWithData:",_2f);
if(_2d){
_bundle=_30;
}
return _2d;
}
}),new objj_method(sel_getUid("bundle"),function(_31,_32){
with(_31){
return _bundle;
}
}),new objj_method(sel_getUid("awakenCustomResources"),function(_33,_34){
with(_33){
return YES;
}
})]);
var _35={},_36={},_37=0;
CPThemeState=function(_38){
var _39=_35[_38];
if(_39===undefined){
if(_38.indexOf("+")===-1){
_39=1<<_37++;
}else{
var _39=0,_3a=_38.split("+"),_3b=_3a.length;
while(_3b--){
var _3c=_3a[_3b],_3d=_35[_3c];
if(_3d===undefined){
_3d=1<<_37++;
_35[_3c]=_3d;
_36[_3d]=_3c;
}
_39|=_3d;
}
}
_35[_38]=_39;
_36[_39]=_38;
}
return _39;
};
CPThemeStateName=function(_3e){
var _3f=_36[_3e];
if(_3f!==undefined){
return _3f;
}
if(!(_3e&(_3e-1))){
return "";
}
var _40=1,_3f="";
for(;_40<_3e;_40<<=1){
if(_3e&_40){
_3f+=(_3f.length===0?"":"+")+_36[_40];
}
}
_36[_3e]=_3f;
return _3f;
};
_36[0]="normal";
CPThemeStateNormal=_35["normal"]=0;
CPThemeStateDisabled=CPThemeState("disabled");
CPThemeStateHighlighted=CPThemeState("highlighted");
CPThemeStateSelected=CPThemeState("selected");
CPThemeStateBezeled=CPThemeState("bezeled");
CPThemeStateBordered=CPThemeState("bordered");
CPThemeStateEditable=CPThemeState("editable");
CPThemeStateEditing=CPThemeState("editing");
CPThemeStateVertical=CPThemeState("vertical");
CPThemeStateDefault=CPThemeState("default");
CPThemeStateCircular=CPThemeState("circular");
var _3=objj_allocateClassPair(CPObject,"_CPThemeAttribute"),_4=_3.isa;
class_addIvars(_3,[new objj_ivar("_name"),new objj_ivar("_defaultValue"),new objj_ivar("_values"),new objj_ivar("_cache"),new objj_ivar("_parentAttribute")]);
objj_registerClassPair(_3);
class_addMethods(_3,[new objj_method(sel_getUid("initWithName:defaultValue:"),function(_41,_42,_43,_44){
with(_41){
_41=objj_msgSendSuper({receiver:_41,super_class:objj_getClass("_CPThemeAttribute").super_class},"init");
if(_41){
_cache={};
_name=_43;
_defaultValue=_44;
_values=objj_msgSend(CPDictionary,"dictionary");
}
return _41;
}
}),new objj_method(sel_getUid("name"),function(_45,_46){
with(_45){
return _name;
}
}),new objj_method(sel_getUid("defaultValue"),function(_47,_48){
with(_47){
return _defaultValue;
}
}),new objj_method(sel_getUid("hasValues"),function(_49,_4a){
with(_49){
return objj_msgSend(_values,"count")>0;
}
}),new objj_method(sel_getUid("isTrivial"),function(_4b,_4c){
with(_4b){
return (objj_msgSend(_values,"count")===1)&&(Number(objj_msgSend(_values,"allKeys")[0])===CPThemeStateNormal);
}
}),new objj_method(sel_getUid("setValue:"),function(_4d,_4e,_4f){
with(_4d){
_cache={};
if(_4f===undefined||_4f===nil){
_values=objj_msgSend(CPDictionary,"dictionary");
}else{
_values=objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",_4f,String(CPThemeStateNormal));
}
}
}),new objj_method(sel_getUid("setValue:forState:"),function(_50,_51,_52,_53){
with(_50){
_cache={};
if((_52===undefined)||(_52===nil)){
objj_msgSend(_values,"removeObjectForKey:",String(_53));
}else{
objj_msgSend(_values,"setObject:forKey:",_52,String(_53));
}
}
}),new objj_method(sel_getUid("value"),function(_54,_55){
with(_54){
return objj_msgSend(_54,"valueForState:",CPThemeStateNormal);
}
}),new objj_method(sel_getUid("valueForState:"),function(_56,_57,_58){
with(_56){
var _59=_cache[_58];
if(_59!==undefined){
return _59;
}
_59=objj_msgSend(_values,"objectForKey:",String(_58));
if((_59===undefined||_59===nil)&&_58!==CPThemeStateNormal){
if(_58&(_58-1)){
var _5a=0,_5b=objj_msgSend(_values,"allKeys"),_5c=_5b.length;
while(_5c--){
var _5d=Number(_5b[_5c]);
if((_5d&_58)===_5d){
var _5e=_5f[_5d];
if(_5e===undefined){
_5e=_60(_5d);
}
if(_5e>_5a){
_5a=_5e;
_59=objj_msgSend(_values,"objectForKey:",String(_5d));
}
}
}
}
if(_59===undefined||_59===nil){
_59=objj_msgSend(_values,"objectForKey:",String(CPThemeStateNormal));
}
}
if(_59===undefined||_59===nil){
_59=objj_msgSend(_parentAttribute,"valueForState:",_58);
}
if(_59===undefined||_59===nil){
_59=_defaultValue;
}
_cache[_58]=_59;
return _59;
}
}),new objj_method(sel_getUid("setParentAttribute:"),function(_61,_62,_63){
with(_61){
if(_parentAttribute===_63){
return;
}
_cache={};
_parentAttribute=_63;
}
}),new objj_method(sel_getUid("attributeMergedWithAttribute:"),function(_64,_65,_66){
with(_64){
var _67=objj_msgSend(objj_msgSend(_CPThemeAttribute,"alloc"),"initWithName:defaultValue:",_name,_defaultValue);
_67._values=objj_msgSend(_values,"copy");
objj_msgSend(_67._values,"addEntriesFromDictionary:",_66._values);
return _67;
}
})]);
var _3=objj_getClass("_CPThemeAttribute");
if(!_3){
throw new SyntaxError("*** Could not find definition for class \"_CPThemeAttribute\"");
}
var _4=_3.isa;
class_addMethods(_3,[new objj_method(sel_getUid("initWithCoder:"),function(_68,_69,_6a){
with(_68){
_68=objj_msgSendSuper({receiver:_68,super_class:objj_getClass("_CPThemeAttribute").super_class},"init");
if(_68){
_cache={};
_name=objj_msgSend(_6a,"decodeObjectForKey:","name");
_values=objj_msgSend(CPDictionary,"dictionary");
if(objj_msgSend(_6a,"containsValueForKey:","value")){
var _6b=CPThemeStateNormal;
if(objj_msgSend(_6a,"containsValueForKey:","state")){
_6b=CPThemeState(objj_msgSend(_6a,"decodeObjectForKey:","state"));
}
objj_msgSend(_values,"setObject:forKey:",objj_msgSend(_6a,"decodeObjectForKey:","value"),_6b);
}else{
var _6c=objj_msgSend(_6a,"decodeObjectForKey:","values"),_6d=objj_msgSend(_6c,"allKeys"),_6e=_6d.length;
while(_6e--){
var key=_6d[_6e];
objj_msgSend(_values,"setObject:forKey:",objj_msgSend(_6c,"objectForKey:",key),CPThemeState(key));
}
}
}
return _68;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_6f,_70,_71){
with(_6f){
objj_msgSend(_71,"encodeObject:forKey:",_name,"name");
var _72=objj_msgSend(_values,"allKeys"),_73=_72.length;
if(_73===1){
var _74=_72[0];
if(Number(_74)!==CPThemeStateNormal){
objj_msgSend(_71,"encodeObject:forKey:",CPThemeStateName(Number(_74)),"state");
}
objj_msgSend(_71,"encodeObject:forKey:",objj_msgSend(_values,"objectForKey:",_74),"value");
}else{
var _75=objj_msgSend(CPDictionary,"dictionary");
while(_73--){
var key=_72[_73];
objj_msgSend(_75,"setObject:forKey:",objj_msgSend(_values,"objectForKey:",key),CPThemeStateName(Number(key)));
}
objj_msgSend(_71,"encodeObject:forKey:",_75,"values");
}
}
})]);
var _5f=[0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6];
var _60=function(_76){
var _77=0,_78=_76;
while(_76){
++_77;
_76&=(_76-1);
}
_5f[_78]=_77;
return _77;
};
_60.displayName="numberOfOnes";
CPThemeAttributeEncode=function(_79,_7a){
var _7b=_7a._values,_7c=objj_msgSend(_7b,"count"),key="$a"+objj_msgSend(_7a,"name");
if(_7c===1){
var _7d=objj_msgSend(_7b,"allKeys")[0];
if(Number(_7d)===0){
objj_msgSend(_79,"encodeObject:forKey:",objj_msgSend(_7b,"objectForKey:",_7d),key);
return YES;
}
}
if(_7c>=1){
objj_msgSend(_79,"encodeObject:forKey:",_7a,key);
return YES;
}
return NO;
};
CPThemeAttributeDecode=function(_7e,_7f,_80,_81,_82){
var key="$a"+_7f;
if(!objj_msgSend(_7e,"containsValueForKey:",key)){
var _83=objj_msgSend(objj_msgSend(_CPThemeAttribute,"alloc"),"initWithName:defaultValue:",_7f,_80);
}else{
var _83=objj_msgSend(_7e,"decodeObjectForKey:",key);
if(!_83.isa||!objj_msgSend(_83,"isKindOfClass:",objj_msgSend(_CPThemeAttribute,"class"))){
var _84=objj_msgSend(objj_msgSend(_CPThemeAttribute,"alloc"),"initWithName:defaultValue:",_7f,_80);
objj_msgSend(_84,"setValue:",_83);
_83=_84;
}
}
if(_81&&_82){
objj_msgSend(_83,"setParentAttribute:",objj_msgSend(_81,"_attributeWithName:forClass:",_7f,_82));
}
return _83;
};
p;14;CPThemeBlend.jt;1632;@STATIC;1.0;I;21;Foundation/CPObject.jI;16;AppKit/CPTheme.jI;29;AppKit/_CPCibCustomResource.jI;30;AppKit/_CPCibKeyedUnarchiver.jt;1497;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("AppKit/CPTheme.j",NO);
objj_executeFile("AppKit/_CPCibCustomResource.j",NO);
objj_executeFile("AppKit/_CPCibKeyedUnarchiver.j",NO);
var _1=objj_allocateClassPair(CPObject,"CPThemeBlend"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_bundle"),new objj_ivar("_themes"),new objj_ivar("_loadDelegate")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("themes"),function(_3,_4){
with(_3){
return _themes;
}
}),new objj_method(sel_getUid("initWithContentsOfURL:"),function(_5,_6,_7){
with(_5){
_5=objj_msgSendSuper({receiver:_5,super_class:objj_getClass("CPThemeBlend").super_class},"init");
if(_5){
_bundle=objj_msgSend(objj_msgSend(CPBundle,"alloc"),"initWithPath:",_7);
}
return _5;
}
}),new objj_method(sel_getUid("loadWithDelegate:"),function(_8,_9,_a){
with(_8){
_loadDelegate=_a;
objj_msgSend(_bundle,"loadWithDelegate:",_8);
}
}),new objj_method(sel_getUid("bundleDidFinishLoading:"),function(_b,_c,_d){
with(_b){
var _e=objj_msgSend(_bundle,"objectForInfoDictionaryKey:","CPKeyedThemes"),_f=_e.length;
while(_f--){
var _10=objj_msgSend(_d,"pathForResource:",_e[_f]),_11=objj_msgSend(objj_msgSend(_CPThemeKeyedUnarchiver,"alloc"),"initForReadingWithData:bundle:",objj_msgSend(objj_msgSend(CPURL,"URLWithString:",_10),"staticResourceData"),_bundle);
objj_msgSend(_11,"decodeObjectForKey:","root");
objj_msgSend(_11,"finishDecoding");
}
objj_msgSend(_loadDelegate,"blendDidFinishLoading:",_b);
}
})]);
p;11;CPToolbar.jt;24284;@STATIC;1.0;I;21;Foundation/CPObject.ji;15;CPPopUpButton.ji;15;CPToolbarItem.jt;24198;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("CPPopUpButton.j",YES);
objj_executeFile("CPToolbarItem.j",YES);
CPToolbarDisplayModeDefault=0;
CPToolbarDisplayModeIconAndLabel=1;
CPToolbarDisplayModeIconOnly=2;
CPToolbarDisplayModeLabelOnly=3;
var _1=nil;
var _2=nil;
var _3=objj_allocateClassPair(CPObject,"CPToolbar"),_4=_3.isa;
class_addIvars(_3,[new objj_ivar("_identifier"),new objj_ivar("_displayMode"),new objj_ivar("_showsBaselineSeparator"),new objj_ivar("_allowsUserCustomization"),new objj_ivar("_isVisible"),new objj_ivar("_delegate"),new objj_ivar("_itemIdentifiers"),new objj_ivar("_identifiedItems"),new objj_ivar("_defaultItems"),new objj_ivar("_allowedItems"),new objj_ivar("_selectableItems"),new objj_ivar("_items"),new objj_ivar("_itemsSortedByVisibilityPriority"),new objj_ivar("_toolbarView"),new objj_ivar("_window")]);
objj_registerClassPair(_3);
class_addMethods(_3,[new objj_method(sel_getUid("init"),function(_5,_6){
with(_5){
return objj_msgSend(_5,"initWithIdentifier:","");
}
}),new objj_method(sel_getUid("initWithIdentifier:"),function(_7,_8,_9){
with(_7){
_7=objj_msgSendSuper({receiver:_7,super_class:objj_getClass("CPToolbar").super_class},"init");
if(_7){
_items=[];
_identifier=_9;
_isVisible=YES;
objj_msgSend(CPToolbar,"_addToolbar:forIdentifier:",_7,_identifier);
}
return _7;
}
}),new objj_method(sel_getUid("setDisplayMode:"),function(_a,_b,_c){
with(_a){
}
}),new objj_method(sel_getUid("identifier"),function(_d,_e){
with(_d){
return _identifier;
}
}),new objj_method(sel_getUid("delegate"),function(_f,_10){
with(_f){
return _delegate;
}
}),new objj_method(sel_getUid("isVisible"),function(_11,_12){
with(_11){
return _isVisible;
}
}),new objj_method(sel_getUid("setVisible:"),function(_13,_14,_15){
with(_13){
if(_isVisible===_15){
return;
}
_isVisible=_15;
objj_msgSend(_window,"_noteToolbarChanged");
}
}),new objj_method(sel_getUid("_window"),function(_16,_17){
with(_16){
return _window;
}
}),new objj_method(sel_getUid("_setWindow:"),function(_18,_19,_1a){
with(_18){
_window=_1a;
}
}),new objj_method(sel_getUid("setDelegate:"),function(_1b,_1c,_1d){
with(_1b){
if(_delegate===_1d){
return;
}
_delegate=_1d;
objj_msgSend(_1b,"_reloadToolbarItems");
}
}),new objj_method(sel_getUid("_loadConfiguration"),function(_1e,_1f){
with(_1e){
}
}),new objj_method(sel_getUid("_toolbarView"),function(_20,_21){
with(_20){
if(!_toolbarView){
_toolbarView=objj_msgSend(objj_msgSend(_CPToolbarView,"alloc"),"initWithFrame:",CPRectMake(0,0,1200,59));
objj_msgSend(_toolbarView,"setToolbar:",_20);
objj_msgSend(_toolbarView,"setAutoresizingMask:",CPViewWidthSizable);
objj_msgSend(_toolbarView,"reloadToolbarItems");
}
return _toolbarView;
}
}),new objj_method(sel_getUid("_reloadToolbarItems"),function(_22,_23){
with(_22){
_itemIdentifiers=objj_msgSend(_defaultItems,"valueForKey:","itemIdentifier")||[];
if(_delegate){
var _24=objj_msgSend(objj_msgSend(_delegate,"toolbarDefaultItemIdentifiers:",_22),"mutableCopy");
if(_24){
_itemIdentifiers=objj_msgSend(_itemIdentifiers,"arrayByAddingObjectsFromArray:",_24);
}
}
var _25=0,_26=objj_msgSend(_itemIdentifiers,"count");
_items=[];
for(;_25<_26;++_25){
var _27=_itemIdentifiers[_25],_28=objj_msgSend(CPToolbarItem,"_standardItemWithItemIdentifier:",_27);
if(!_28){
_28=objj_msgSend(_identifiedItems,"objectForKey:",_27);
}
if(!_28&&_delegate){
_28=objj_msgSend(_delegate,"toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar:",_22,_27,YES);
}
_28=objj_msgSend(_28,"copy");
if(_28===nil){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Toolbar delegate "+_delegate+" returned nil toolbar item for identifier \""+_27+"\"");
}
_28._toolbar=_22;
objj_msgSend(_items,"addObject:",_28);
}
_itemsSortedByVisibilityPriority=objj_msgSend(_items,"sortedArrayUsingFunction:context:",_29,NULL);
objj_msgSend(_toolbarView,"reloadToolbarItems");
}
}),new objj_method(sel_getUid("items"),function(_2a,_2b){
with(_2a){
return _items;
}
}),new objj_method(sel_getUid("visibleItems"),function(_2c,_2d){
with(_2c){
return objj_msgSend(_toolbarView,"visibleItems");
}
}),new objj_method(sel_getUid("itemsSortedByVisibilityPriority"),function(_2e,_2f){
with(_2e){
return _itemsSortedByVisibilityPriority;
}
}),new objj_method(sel_getUid("validateVisibleToolbarItems"),function(_30,_31){
with(_30){
var _32=objj_msgSend(_30,"visibleItems"),_33=objj_msgSend(_32,"count");
while(_33--){
objj_msgSend(_32[_33],"validate");
}
}
}),new objj_method(sel_getUid("_itemForItemIdentifier:willBeInsertedIntoToolbar:"),function(_34,_35,_36,_37){
with(_34){
var _38=objj_msgSend(_identifiedItems,"objectForKey:",_36);
if(!_38){
_38=objj_msgSend(CPToolbarItem,"_standardItemWithItemIdentifier:",_36);
if(_delegate&&!_38){
_38=objj_msgSend(objj_msgSend(_delegate,"toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar:",_34,_36,_37),"copy");
if(!_38){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Toolbar delegate "+_delegate+" returned nil toolbar item for identifier "+_36);
}
}
objj_msgSend(_identifiedItems,"setObject:forKey:",_38,_36);
}
return _38;
}
}),new objj_method(sel_getUid("_itemsWithIdentifiers:"),function(_39,_3a,_3b){
with(_39){
var _3c=[];
for(var i=0;i<_3b.length;i++){
objj_msgSend(_3c,"addObject:",objj_msgSend(_39,"_itemForItemIdentifier:willBeInsertedIntoToolbar:",_3b[i],NO));
}
return _3c;
}
}),new objj_method(sel_getUid("_defaultToolbarItems"),function(_3d,_3e){
with(_3d){
if(!_defaultItems&&objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("toolbarDefaultItemIdentifiers:"))){
_defaultItems=[];
var _3f=objj_msgSend(_delegate,"toolbarDefaultItemIdentifiers:",_3d),_40=0,_41=objj_msgSend(_3f,"count");
for(;_40<_41;++_40){
objj_msgSend(_defaultItems,"addObject:",objj_msgSend(_3d,"_itemForItemIdentifier:willBeInsertedIntoToolbar:",_3f[_40],NO));
}
}
return _defaultItems;
}
}),new objj_method(sel_getUid("toolbarItemDidChange:"),function(_42,_43,_44){
with(_42){
if(objj_msgSend(_identifiedItems,"objectForKey:",objj_msgSend(_44,"itemIdentifier"))){
objj_msgSend(_identifiedItems,"setObject:forKey:",_44,objj_msgSend(_44,"itemIdentifier"));
}
var _45=0,_46=objj_msgSend(_items,"count");
for(;_45<=_46;++_45){
var _47=_items[_45];
if(objj_msgSend(_47,"itemIdentifier")===objj_msgSend(_44,"itemIdentifier")){
_items[_45]=_44;
_itemsSortedByVisibilityPriority=objj_msgSend(_items,"sortedArrayUsingFunction:context:",_29,NULL);
objj_msgSend(_toolbarView,"reloadToolbarItems");
}
}
}
})]);
class_addMethods(_4,[new objj_method(sel_getUid("initialize"),function(_48,_49){
with(_48){
if(_48!=objj_msgSend(CPToolbar,"class")){
return;
}
_1=objj_msgSend(CPDictionary,"dictionary");
_2=objj_msgSend(CPDictionary,"dictionary");
}
}),new objj_method(sel_getUid("_addToolbar:forIdentifier:"),function(_4a,_4b,_4c,_4d){
with(_4a){
var _4e=objj_msgSend(_1,"objectForKey:",_4d);
if(!_4e){
_4e=[];
objj_msgSend(_1,"setObject:forKey:",_4e,_4d);
}
objj_msgSend(_4e,"addObject:",_4c);
}
})]);
var _4f="CPToolbarIdentifierKey",_50="CPToolbarDisplayModeKey",_51="CPToolbarShowsBaselineSeparatorKey",_52="CPToolbarAllowsUserCustomizationKey",_53="CPToolbarIsVisibleKey",_54="CPToolbarDelegateKey",_55="CPToolbarIdentifiedItemsKey",_56="CPToolbarDefaultItemsKey",_57="CPToolbarAllowedItemsKey",_58="CPToolbarSelectableItemsKey";
var _3=objj_getClass("CPToolbar");
if(!_3){
throw new SyntaxError("*** Could not find definition for class \"CPToolbar\"");
}
var _4=_3.isa;
class_addMethods(_3,[new objj_method(sel_getUid("initWithCoder:"),function(_59,_5a,_5b){
with(_59){
_59=objj_msgSendSuper({receiver:_59,super_class:objj_getClass("CPToolbar").super_class},"init");
if(_59){
_identifier=objj_msgSend(_5b,"decodeObjectForKey:",_4f);
_displayMode=objj_msgSend(_5b,"decodeIntForKey:",_50);
_showsBaselineSeparator=objj_msgSend(_5b,"decodeBoolForKey:",_51);
_allowsUserCustomization=objj_msgSend(_5b,"decodeBoolForKey:",_52);
_isVisible=objj_msgSend(_5b,"decodeBoolForKey:",_53);
_identifiedItems=objj_msgSend(_5b,"decodeObjectForKey:",_55);
_defaultItems=objj_msgSend(_5b,"decodeObjectForKey:",_56);
_allowedItems=objj_msgSend(_5b,"decodeObjectForKey:",_57);
_selectableItems=objj_msgSend(_5b,"decodeObjectForKey:",_58);
objj_msgSend(objj_msgSend(_identifiedItems,"allValues"),"makeObjectsPerformSelector:withObject:",sel_getUid("_setToolbar:"),_59);
_items=[];
objj_msgSend(CPToolbar,"_addToolbar:forIdentifier:",_59,_identifier);
objj_msgSend(_59,"setDelegate:",objj_msgSend(_5b,"decodeObjectForKey:",_54));
objj_msgSend(_59,"_reloadToolbarItems");
}
return _59;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_5c,_5d,_5e){
with(_5c){
objj_msgSend(_5e,"encodeObject:forKey:",_identifier,_4f);
objj_msgSend(_5e,"encodeInt:forKey:",_displayMode,_50);
objj_msgSend(_5e,"encodeBool:forKey:",_showsBaselineSeparator,_51);
objj_msgSend(_5e,"encodeBool:forKey:",_allowsUserCustomization,_52);
objj_msgSend(_5e,"encodeBool:forKey:",_isVisible,_53);
objj_msgSend(_5e,"encodeObject:forKey:",_identifiedItems,_55);
objj_msgSend(_5e,"encodeObject:forKey:",_defaultItems,_56);
objj_msgSend(_5e,"encodeObject:forKey:",_allowedItems,_57);
objj_msgSend(_5e,"encodeObject:forKey:",_selectableItems,_58);
objj_msgSend(_5e,"encodeConditionalObject:forKey:",_delegate,_54);
}
})]);
var _5f=nil,_60=nil,_61=nil;
var _62=5,_63=10,_64=20;
var _65=function(_66,_67,_68,_69){
return {index:_66,view:_67,label:_68,minWidth:_69};
};
var _3=objj_allocateClassPair(CPView,"_CPToolbarView"),_4=_3.isa;
class_addIvars(_3,[new objj_ivar("_toolbar"),new objj_ivar("_flexibleWidthIndexes"),new objj_ivar("_visibleFlexibleWidthIndexes"),new objj_ivar("_itemInfos"),new objj_ivar("_viewsForToolbarItems"),new objj_ivar("_visibleItems"),new objj_ivar("_invisibleItems"),new objj_ivar("_additionalItemsButton"),new objj_ivar("_labelColor"),new objj_ivar("_labelShadowColor"),new objj_ivar("_minWidth"),new objj_ivar("_FIXME_isHUD")]);
objj_registerClassPair(_3);
class_addMethods(_3,[new objj_method(sel_getUid("visibleItems"),function(_6a,_6b){
with(_6a){
return _visibleItems;
}
}),new objj_method(sel_getUid("initWithFrame:"),function(_6c,_6d,_6e){
with(_6c){
_6c=objj_msgSendSuper({receiver:_6c,super_class:objj_getClass("_CPToolbarView").super_class},"initWithFrame:",_6e);
if(_6c){
_minWidth=0;
_labelColor=objj_msgSend(CPColor,"blackColor");
_labelShadowColor=objj_msgSend(CPColor,"colorWithWhite:alpha:",1,0.75);
_additionalItemsButton=objj_msgSend(objj_msgSend(CPPopUpButton,"alloc"),"initWithFrame:pullsDown:",CGRectMake(0,0,10,15),YES);
objj_msgSend(_additionalItemsButton,"setBordered:",NO);
objj_msgSend(_additionalItemsButton,"setImagePosition:",CPImageOnly);
objj_msgSend(objj_msgSend(_additionalItemsButton,"menu"),"setShowsStateColumn:",NO);
objj_msgSend(_additionalItemsButton,"setAlternateImage:",_61);
}
return _6c;
}
}),new objj_method(sel_getUid("setToolbar:"),function(_6f,_70,_71){
with(_6f){
_toolbar=_71;
}
}),new objj_method(sel_getUid("toolbar"),function(_72,_73){
with(_72){
return _toolbar;
}
}),new objj_method(sel_getUid("FIXME_setIsHUD:"),function(_74,_75,_76){
with(_74){
if(_FIXME_isHUD===_76){
return;
}
_FIXME_isHUD=_76;
var _77=objj_msgSend(_toolbar,"items"),_78=objj_msgSend(_77,"count");
while(_78--){
objj_msgSend(objj_msgSend(_74,"viewForItem:",_77[_78]),"FIXME_setIsHUD:",_76);
}
}
}),new objj_method(sel_getUid("resizeSubviewsWithOldSize:"),function(_79,_7a,_7b){
with(_79){
objj_msgSend(_79,"tile");
}
}),new objj_method(sel_getUid("viewForItem:"),function(_7c,_7d,_7e){
with(_7c){
return _viewsForToolbarItems[objj_msgSend(_7e,"UID")]||nil;
}
}),new objj_method(sel_getUid("tile"),function(_7f,_80){
with(_7f){
var _81=objj_msgSend(_toolbar,"items"),_82=CGRectGetWidth(objj_msgSend(_7f,"bounds")),_83=_minWidth,_84=[];
_visibleItems=_81;
if(_82<_83){
_82-=_64;
_visibleItems=objj_msgSend(_visibleItems,"copy");
var _85=objj_msgSend(_toolbar,"itemsSortedByVisibilityPriority"),_86=_85.length;
while(_83>_82&&_86){
var _87=_85[--_86],_88=objj_msgSend(_7f,"viewForItem:",_87);
_83-=objj_msgSend(_88,"minSize").width+_63;
objj_msgSend(_visibleItems,"removeObjectIdenticalTo:",_87);
objj_msgSend(_84,"addObject:",_87);
objj_msgSend(_88,"setHidden:",YES);
objj_msgSend(_88,"FIXME_setIsHUD:",_FIXME_isHUD);
}
}
var _86=objj_msgSend(_81,"count"),_89=0;
while(_86--){
var _88=objj_msgSend(_7f,"viewForItem:",_81[_86]),_8a=objj_msgSend(_88,"minSize");
if(_89<_8a.height){
_89=_8a.height;
}
}
var _86=_visibleItems.length;
flexibleItemIndexes=objj_msgSend(CPIndexSet,"indexSet");
while(_86--){
var _87=_visibleItems[_86],_88=objj_msgSend(_7f,"viewForItem:",_87),_8a=objj_msgSend(_88,"minSize");
if(_8a.width!==objj_msgSend(_88,"maxSize").width){
objj_msgSend(flexibleItemIndexes,"addIndex:",_86);
}else{
objj_msgSend(_88,"setFrameSize:",CGSizeMake(_8a.width,_89));
}
objj_msgSend(_88,"setHidden:",NO);
}
var _8b=_82-_83,_8c=0;
while(_8b&&objj_msgSend(flexibleItemIndexes,"count")){
_8c+=_8b/objj_msgSend(flexibleItemIndexes,"count");
_8b=0;
var _8d=CPNotFound;
while((_8d=objj_msgSend(flexibleItemIndexes,"indexGreaterThanIndex:",_8d))!==CPNotFound){
var _87=_visibleItems[_8d],_88=objj_msgSend(_7f,"viewForItem:",_87),_8e=objj_msgSend(_88,"minSize").width+_8c,_8f=MIN(_8e,objj_msgSend(_88,"maxSize").width);
if(_8f<_8e){
objj_msgSend(flexibleItemIndexes,"removeIndex:",_8d);
_8b+=_8e-_8f;
}
objj_msgSend(_88,"setFrameSize:",CGSizeMake(_8f,_89));
}
}
var _8d=0,_86=_visibleItems.length,x=_63;
for(;_8d<_86;++_8d){
var _88=objj_msgSend(_7f,"viewForItem:",_visibleItems[_8d]),_90=CGRectGetWidth(objj_msgSend(_88,"frame"));
objj_msgSend(_88,"setFrame:",CGRectMake(x,0,_90,_89));
x+=_90+_63;
}
var _91=NO;
if(objj_msgSend(_84,"count")){
var _8d=0,_86=objj_msgSend(_81,"count");
_invisibleItems=[];
for(;_8d<_86;++_8d){
var _87=_81[_8d];
if(objj_msgSend(_84,"indexOfObjectIdenticalTo:",_87)!==CPNotFound){
objj_msgSend(_invisibleItems,"addObject:",_87);
var _92=objj_msgSend(_87,"itemIdentifier");
if(_92!==CPToolbarSpaceItemIdentifier&&_92!==CPToolbarFlexibleSpaceItemIdentifier&&_92!==CPToolbarSeparatorItemIdentifier){
_91=YES;
}
}
}
}
if(_91){
objj_msgSend(_additionalItemsButton,"setFrameOrigin:",CGPointMake(_82+5,(CGRectGetHeight(objj_msgSend(_7f,"bounds"))-CGRectGetHeight(objj_msgSend(_additionalItemsButton,"frame")))/2));
objj_msgSend(_7f,"addSubview:",_additionalItemsButton);
objj_msgSend(_additionalItemsButton,"removeAllItems");
objj_msgSend(_additionalItemsButton,"addItemWithTitle:","Additional Items");
objj_msgSend(objj_msgSend(_additionalItemsButton,"itemArray")[0],"setImage:",_60);
var _8d=0,_86=objj_msgSend(_invisibleItems,"count"),_93=NO;
for(;_8d<_86;++_8d){
var _87=_invisibleItems[_8d],_92=objj_msgSend(_87,"itemIdentifier");
if(_92===CPToolbarSpaceItemIdentifier||_92===CPToolbarFlexibleSpaceItemIdentifier){
continue;
}
if(_92===CPToolbarSeparatorItemIdentifier){
if(_93){
objj_msgSend(_additionalItemsButton,"addItem:",objj_msgSend(CPMenuItem,"separatorItem"));
}
continue;
}
_93=YES;
objj_msgSend(_additionalItemsButton,"addItemWithTitle:",objj_msgSend(_87,"label"));
var _94=objj_msgSend(_additionalItemsButton,"itemArray")[_8d+1];
objj_msgSend(_94,"setImage:",objj_msgSend(_87,"image"));
objj_msgSend(_94,"setTarget:",objj_msgSend(_87,"target"));
objj_msgSend(_94,"setAction:",objj_msgSend(_87,"action"));
}
}else{
objj_msgSend(_additionalItemsButton,"removeFromSuperview");
}
}
}),new objj_method(sel_getUid("reloadToolbarItems"),function(_95,_96){
with(_95){
var _97=objj_msgSend(_95,"subviews"),_98=_97.length;
while(_98--){
objj_msgSend(_97[_98],"removeFromSuperview");
}
var _99=objj_msgSend(_toolbar,"items"),_9a=0;
_98=_99.length;
_minWidth=_63;
_viewsForToolbarItems={};
for(;_9a<_98;++_9a){
var _9b=_99[_9a],_9c=objj_msgSend(objj_msgSend(_CPToolbarItemView,"alloc"),"initWithToolbarItem:toolbar:",_9b,_95);
_viewsForToolbarItems[objj_msgSend(_9b,"UID")]=_9c;
objj_msgSend(_95,"addSubview:",_9c);
_minWidth+=objj_msgSend(_9c,"minSize").width+_63;
}
objj_msgSend(_95,"tile");
}
})]);
class_addMethods(_4,[new objj_method(sel_getUid("initialize"),function(_9d,_9e){
with(_9d){
if(_9d!==objj_msgSend(_CPToolbarView,"class")){
return;
}
var _9f=objj_msgSend(CPBundle,"bundleForClass:",_9d);
_60=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_9f,"pathForResource:","_CPToolbarView/_CPToolbarViewExtraItemsImage.png"),CPSizeMake(10,15));
_61=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_9f,"pathForResource:","_CPToolbarView/_CPToolbarViewExtraItemsAlternateImage.png"),CGSizeMake(10,15));
}
})]);
var _29=function(lhs,rhs){
var _a0=objj_msgSend(lhs,"visibilityPriority"),_a1=objj_msgSend(rhs,"visibilityPriority");
if(_a0==_a1){
return CPOrderedSame;
}
if(_a0>_a1){
return CPOrderedAscending;
}
return CPOrderedDescending;
};
var _a2=5,_a3=2;
var _3=objj_allocateClassPair(CPControl,"_CPToolbarItemView"),_4=_3.isa;
class_addIvars(_3,[new objj_ivar("_minSize"),new objj_ivar("_maxSize"),new objj_ivar("_labelSize"),new objj_ivar("_toolbarItem"),new objj_ivar("_toolbar"),new objj_ivar("_imageView"),new objj_ivar("_view"),new objj_ivar("_labelField"),new objj_ivar("_FIXME_isHUD")]);
objj_registerClassPair(_3);
class_addMethods(_3,[new objj_method(sel_getUid("minSize"),function(_a4,_a5){
with(_a4){
return _minSize;
}
}),new objj_method(sel_getUid("maxSize"),function(_a6,_a7){
with(_a6){
return _maxSize;
}
}),new objj_method(sel_getUid("initWithToolbarItem:toolbar:"),function(_a8,_a9,_aa,_ab){
with(_a8){
_a8=objj_msgSendSuper({receiver:_a8,super_class:objj_getClass("_CPToolbarItemView").super_class},"init");
if(_a8){
_toolbarItem=_aa;
_labelField=objj_msgSend(objj_msgSend(CPTextField,"alloc"),"initWithFrame:",CGRectMakeZero());
objj_msgSend(_labelField,"setFont:",objj_msgSend(CPFont,"systemFontOfSize:",11));
objj_msgSend(_labelField,"setTextColor:",objj_msgSend(_a8,"FIXME_labelColor"));
objj_msgSend(_labelField,"setTextShadowColor:",objj_msgSend(_a8,"FIXME_labelShadowColor"));
objj_msgSend(_labelField,"setTextShadowOffset:",CGSizeMake(0,1));
objj_msgSend(_labelField,"setAutoresizingMask:",CPViewWidthSizable|CPViewMinXMargin);
objj_msgSend(_a8,"addSubview:",_labelField);
objj_msgSend(_a8,"updateFromItem");
_toolbar=_ab;
var _ac=["label","image","alternateImage","minSize","maxSize","target","action","enabled"],_ad=0,_ae=objj_msgSend(_ac,"count");
for(;_ad<_ae;++_ad){
objj_msgSend(_toolbarItem,"addObserver:forKeyPath:options:context:",_a8,_ac[_ad],0,NULL);
}
}
return _a8;
}
}),new objj_method(sel_getUid("FIXME_setIsHUD:"),function(_af,_b0,_b1){
with(_af){
_FIXME_isHUD=_b1;
objj_msgSend(_labelField,"setTextColor:",objj_msgSend(_af,"FIXME_labelColor"));
objj_msgSend(_labelField,"setTextShadowColor:",objj_msgSend(_af,"FIXME_labelShadowColor"));
}
}),new objj_method(sel_getUid("updateFromItem"),function(_b2,_b3){
with(_b2){
var _b4=objj_msgSend(_toolbarItem,"itemIdentifier");
if(_b4===CPToolbarSpaceItemIdentifier||_b4===CPToolbarFlexibleSpaceItemIdentifier||_b4===CPToolbarSeparatorItemIdentifier){
objj_msgSend(_view,"removeFromSuperview");
objj_msgSend(_imageView,"removeFromSuperview");
_minSize=objj_msgSend(_toolbarItem,"minSize");
_maxSize=objj_msgSend(_toolbarItem,"maxSize");
if(_b4===CPToolbarSeparatorItemIdentifier){
_view=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMake(0,0,2,32));
sizes={};
sizes["CPToolbarItemSeparator"]=[CGSizeMake(2,26),CGSizeMake(2,1),CGSizeMake(2,26)];
objj_msgSend(_view,"setBackgroundColor:",_CPControlThreePartImagePattern(YES,sizes,"CPToolbarItem","Separator"));
objj_msgSend(_b2,"addSubview:",_view);
}
return;
}
objj_msgSend(_b2,"setTarget:",objj_msgSend(_toolbarItem,"target"));
objj_msgSend(_b2,"setAction:",objj_msgSend(_toolbarItem,"action"));
var _b5=objj_msgSend(_toolbarItem,"view")||nil;
if(_b5!==_view){
if(!_b5){
objj_msgSend(_view,"removeFromSuperview");
}else{
objj_msgSend(_b2,"addSubview:",_b5);
objj_msgSend(_imageView,"removeFromSuperview");
}
_view=_b5;
}
if(!_view){
if(!_imageView){
_imageView=objj_msgSend(objj_msgSend(CPImageView,"alloc"),"initWithFrame:",objj_msgSend(_b2,"bounds"));
objj_msgSend(_imageView,"setImageScaling:",CPScaleNone);
objj_msgSend(_b2,"addSubview:",_imageView);
}
objj_msgSend(_imageView,"setImage:",objj_msgSend(_toolbarItem,"image"));
}
var _b6=objj_msgSend(_toolbarItem,"minSize"),_b7=objj_msgSend(_toolbarItem,"maxSize");
objj_msgSend(_labelField,"setStringValue:",objj_msgSend(_toolbarItem,"label"));
objj_msgSend(_labelField,"sizeToFit");
objj_msgSend(_b2,"setEnabled:",objj_msgSend(_toolbarItem,"isEnabled"));
_labelSize=objj_msgSend(_labelField,"frame").size;
_minSize=CGSizeMake(MAX(_labelSize.width,_b6.width),_labelSize.height+_b6.height+_a3+_a2);
_maxSize=CGSizeMake(MAX(_labelSize.width,_b6.width),100000000);
objj_msgSend(_toolbar,"tile");
}
}),new objj_method(sel_getUid("layoutSubviews"),function(_b8,_b9){
with(_b8){
var _ba=objj_msgSend(_toolbarItem,"itemIdentifier");
if(_ba===CPToolbarSpaceItemIdentifier||_ba===CPToolbarFlexibleSpaceItemIdentifier){
return;
}
var _bb=objj_msgSend(_b8,"bounds"),_bc=(_bb.size.width);
if(_ba===CPToolbarSeparatorItemIdentifier){
return objj_msgSend(_view,"setFrame:",CGRectMake(ROUND((_bc-2)/2),0,2,(_bb.size.height)));
}
var _bd=_view||_imageView,_be=objj_msgSend(_toolbarItem,"maxSize"),_bf=(_bb.size.height)-_labelSize.height-_a3-_a2,_c0=MIN(_be.width,_bc),_c1=MIN(_be.height,_bf);
objj_msgSend(_bd,"setFrame:",CGRectMake(ROUND((_bc-_c0)/2),_a2+ROUND((_bf-_c1)/2),_c0,_c1));
objj_msgSend(_labelField,"setFrameOrigin:",CGPointMake(ROUND((_bc-_labelSize.width)/2),_a2+_bf+_a3));
}
}),new objj_method(sel_getUid("mouseDown:"),function(_c2,_c3,_c4){
with(_c2){
if(objj_msgSend(_toolbarItem,"view")){
return objj_msgSend(objj_msgSend(_c2,"nextResponder"),"mouseDown:",_c4);
}
var _c5=objj_msgSend(_toolbarItem,"itemIdentifier");
if(_c5===CPToolbarSpaceItemIdentifier||_c5===CPToolbarFlexibleSpaceItemIdentifier||_c5===CPToolbarSeparatorItemIdentifier){
return objj_msgSend(objj_msgSend(_c2,"nextResponder"),"mouseDown:",_c4);
}
objj_msgSendSuper({receiver:_c2,super_class:objj_getClass("_CPToolbarItemView").super_class},"mouseDown:",_c4);
}
}),new objj_method(sel_getUid("setEnabled:"),function(_c6,_c7,_c8){
with(_c6){
objj_msgSendSuper({receiver:_c6,super_class:objj_getClass("_CPToolbarItemView").super_class},"setEnabled:",_c8);
if(_c8){
objj_msgSend(_imageView,"setAlphaValue:",1);
objj_msgSend(_labelField,"setAlphaValue:",1);
}else{
objj_msgSend(_imageView,"setAlphaValue:",0.5);
objj_msgSend(_labelField,"setAlphaValue:",0.5);
}
}
}),new objj_method(sel_getUid("FIXME_labelColor"),function(_c9,_ca){
with(_c9){
if(_FIXME_isHUD){
return objj_msgSend(CPColor,"whiteColor");
}
return objj_msgSend(CPColor,"blackColor");
}
}),new objj_method(sel_getUid("FIXME_labelShadowColor"),function(_cb,_cc){
with(_cb){
if(_FIXME_isHUD){
return objj_msgSend(_cb,"isHighlighted")?objj_msgSend(CPColor,"colorWithWhite:alpha:",1,0.5):objj_msgSend(CPColor,"clearColor");
}
return objj_msgSend(_cb,"isHighlighted")?objj_msgSend(CPColor,"colorWithWhite:alpha:",0,0.3):objj_msgSend(CPColor,"colorWithWhite:alpha:",1,0.75);
}
}),new objj_method(sel_getUid("setHighlighted:"),function(_cd,_ce,_cf){
with(_cd){
objj_msgSendSuper({receiver:_cd,super_class:objj_getClass("_CPToolbarItemView").super_class},"setHighlighted:",_cf);
if(_cf){
var _d0=objj_msgSend(_toolbarItem,"alternateImage");
if(_d0){
objj_msgSend(_imageView,"setImage:",_d0);
}
objj_msgSend(_labelField,"setTextShadowOffset:",CGSizeMakeZero());
}else{
var _d1=objj_msgSend(_toolbarItem,"image");
if(_d1){
objj_msgSend(_imageView,"setImage:",_d1);
}
objj_msgSend(_labelField,"setTextShadowOffset:",CGSizeMake(0,1));
}
objj_msgSend(_labelField,"setTextShadowColor:",objj_msgSend(_cd,"FIXME_labelShadowColor"));
}
}),new objj_method(sel_getUid("sendAction:to:"),function(_d2,_d3,_d4,_d5){
with(_d2){
objj_msgSend(CPApp,"sendAction:to:from:",_d4,_d5,_toolbarItem);
}
}),new objj_method(sel_getUid("observeValueForKeyPath:ofObject:change:context:"),function(_d6,_d7,_d8,_d9,_da,_db){
with(_d6){
if(_d8==="enabled"){
objj_msgSend(_d6,"setEnabled:",objj_msgSend(_d9,"isEnabled"));
}else{
if(_d8==="target"){
objj_msgSend(_d6,"setTarget:",objj_msgSend(_d9,"target"));
}else{
if(_d8==="action"){
objj_msgSend(_d6,"setAction:",objj_msgSend(_d9,"action"));
}else{
objj_msgSend(_d6,"updateFromItem");
}
}
}
}
})]);
p;15;CPToolbarItem.jt;13731;@STATIC;1.0;I;21;Foundation/CPObject.jI;21;Foundation/CPString.jI;16;AppKit/CPImage.jI;15;AppKit/CPView.ji;29;_CPToolbarFlexibleSpaceItem.ji;26;_CPToolbarShowColorsItem.ji;25;_CPToolbarSeparatorItem.ji;21;_CPToolbarSpaceItem.jt;13497;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("AppKit/CPImage.j",NO);
objj_executeFile("AppKit/CPView.j",NO);
CPToolbarItemVisibilityPriorityStandard=0;
CPToolbarItemVisibilityPriorityLow=-1000;
CPToolbarItemVisibilityPriorityHigh=1000;
CPToolbarItemVisibilityPriorityUser=2000;
CPToolbarSeparatorItemIdentifier="CPToolbarSeparatorItem";
CPToolbarSpaceItemIdentifier="CPToolbarSpaceItem";
CPToolbarFlexibleSpaceItemIdentifier="CPToolbarFlexibleSpaceItem";
CPToolbarShowColorsItemIdentifier="CPToolbarShowColorsItem";
CPToolbarShowFontsItemIdentifier="CPToolbarShowFontsItem";
CPToolbarCustomizeToolbarItemIdentifier="CPToolbarCustomizeToolbarItem";
CPToolbarPrintItemIdentifier="CPToolbarPrintItem";
var _1=objj_allocateClassPair(CPObject,"CPToolbarItem"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_itemIdentifier"),new objj_ivar("_toolbar"),new objj_ivar("_label"),new objj_ivar("_paletteLabel"),new objj_ivar("_toolTip"),new objj_ivar("_tag"),new objj_ivar("_target"),new objj_ivar("_action"),new objj_ivar("_isEnabled"),new objj_ivar("_image"),new objj_ivar("_alternateImage"),new objj_ivar("_view"),new objj_ivar("_minSize"),new objj_ivar("_maxSize"),new objj_ivar("_visibilityPriority"),new objj_ivar("_autovalidates")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("init"),function(_3,_4){
with(_3){
return objj_msgSend(_3,"initWithItemIdentifier:","");
}
}),new objj_method(sel_getUid("initWithItemIdentifier:"),function(_5,_6,_7){
with(_5){
_5=objj_msgSendSuper({receiver:_5,super_class:objj_getClass("CPToolbarItem").super_class},"init");
if(_5){
_itemIdentifier=_7;
_tag=0;
_isEnabled=YES;
_minSize=CGSizeMakeZero();
_maxSize=CGSizeMakeZero();
_visibilityPriority=CPToolbarItemVisibilityPriorityStandard;
_autovalidates=YES;
}
return _5;
}
}),new objj_method(sel_getUid("itemIdentifier"),function(_8,_9){
with(_8){
return _itemIdentifier;
}
}),new objj_method(sel_getUid("toolbar"),function(_a,_b){
with(_a){
return _toolbar;
}
}),new objj_method(sel_getUid("_setToolbar:"),function(_c,_d,_e){
with(_c){
_toolbar=_e;
}
}),new objj_method(sel_getUid("label"),function(_f,_10){
with(_f){
return _label;
}
}),new objj_method(sel_getUid("setLabel:"),function(_11,_12,_13){
with(_11){
_label=_13;
}
}),new objj_method(sel_getUid("paletteLabel"),function(_14,_15){
with(_14){
return _paletteLabel;
}
}),new objj_method(sel_getUid("setPaletteLabel:"),function(_16,_17,_18){
with(_16){
_paletteLabel=_18;
}
}),new objj_method(sel_getUid("toolTip"),function(_19,_1a){
with(_19){
if(objj_msgSend(_view,"respondsToSelector:",sel_getUid("toolTip"))){
return objj_msgSend(_view,"toolTip");
}
return _toolTip;
}
}),new objj_method(sel_getUid("setToolTip:"),function(_1b,_1c,_1d){
with(_1b){
if(objj_msgSend(_view,"respondsToSelector:",sel_getUid("setToolTip:"))){
objj_msgSend(_view,"setToolTip:",_1d);
}
_toolTip=_1d;
}
}),new objj_method(sel_getUid("tag"),function(_1e,_1f){
with(_1e){
if(objj_msgSend(_view,"respondsToSelector:",sel_getUid("tag"))){
return objj_msgSend(_view,"tag");
}
return _tag;
}
}),new objj_method(sel_getUid("setTag:"),function(_20,_21,_22){
with(_20){
if(objj_msgSend(_view,"respondsToSelector:",sel_getUid("setTag:"))){
objj_msgSend(_view,"setTag:",_22);
}
_tag=_22;
}
}),new objj_method(sel_getUid("target"),function(_23,_24){
with(_23){
if(_view){
return objj_msgSend(_view,"respondsToSelector:",sel_getUid("target"))?objj_msgSend(_view,"target"):nil;
}
return _target;
}
}),new objj_method(sel_getUid("setTarget:"),function(_25,_26,_27){
with(_25){
if(!_view){
_target=_27;
}else{
if(objj_msgSend(_view,"respondsToSelector:",sel_getUid("setTarget:"))){
objj_msgSend(_view,"setTarget:",_27);
}
}
}
}),new objj_method(sel_getUid("action"),function(_28,_29){
with(_28){
if(_view){
return objj_msgSend(_view,"respondsToSelector:",sel_getUid("action"))?objj_msgSend(_view,"action"):nil;
}
return _action;
}
}),new objj_method(sel_getUid("setAction:"),function(_2a,_2b,_2c){
with(_2a){
if(!_view){
_action=_2c;
}else{
if(objj_msgSend(_view,"respondsToSelector:",sel_getUid("setAction:"))){
objj_msgSend(_view,"setAction:",_2c);
}
}
}
}),new objj_method(sel_getUid("isEnabled"),function(_2d,_2e){
with(_2d){
if(objj_msgSend(_view,"respondsToSelector:",sel_getUid("isEnabled"))){
return objj_msgSend(_view,"isEnabled");
}
return _isEnabled;
}
}),new objj_method(sel_getUid("setEnabled:"),function(_2f,_30,_31){
with(_2f){
if(objj_msgSend(_view,"respondsToSelector:",sel_getUid("setEnabled:"))){
objj_msgSend(_view,"setEnabled:",_31);
}
_isEnabled=_31;
}
}),new objj_method(sel_getUid("image"),function(_32,_33){
with(_32){
if(objj_msgSend(_view,"respondsToSelector:",sel_getUid("image"))){
return objj_msgSend(_view,"image");
}
return _image;
}
}),new objj_method(sel_getUid("setImage:"),function(_34,_35,_36){
with(_34){
if(objj_msgSend(_view,"respondsToSelector:",sel_getUid("setImage:"))){
objj_msgSend(_view,"setImage:",_36);
}
_image=_36;
if(!_image){
return;
}
if(_minSize.width===0&&_minSize.height===0&&_maxSize.width===0&&_maxSize.height===0){
var _37=objj_msgSend(_image,"size");
if(_37.width>0||_37.height>0){
objj_msgSend(_34,"setMinSize:",_37);
objj_msgSend(_34,"setMaxSize:",_37);
}
}
}
}),new objj_method(sel_getUid("setAlternateImage:"),function(_38,_39,_3a){
with(_38){
if(objj_msgSend(_view,"respondsToSelector:",sel_getUid("setAlternateImage:"))){
objj_msgSend(_view,"setAlternateImage:",_3a);
}
_alternateImage=_3a;
}
}),new objj_method(sel_getUid("alternateImage"),function(_3b,_3c){
with(_3b){
if(objj_msgSend(_view,"respondsToSelector:",sel_getUid("alternateIamge"))){
return objj_msgSend(_view,"alternateImage");
}
return _alternateImage;
}
}),new objj_method(sel_getUid("view"),function(_3d,_3e){
with(_3d){
return _view;
}
}),new objj_method(sel_getUid("setView:"),function(_3f,_40,_41){
with(_3f){
if(_view==_41){
return;
}
_view=_41;
if(_view){
if(_tag!==0&&objj_msgSend(_view,"respondsToSelector:",sel_getUid("setTag:"))){
objj_msgSend(_view,"setTag:",_tag);
}
_target=nil;
_action=nil;
}
}
}),new objj_method(sel_getUid("minSize"),function(_42,_43){
with(_42){
return _minSize;
}
}),new objj_method(sel_getUid("setMinSize:"),function(_44,_45,_46){
with(_44){
if(!_46.height||!_46.width){
return;
}
_minSize=CGSizeMakeCopy(_46);
_maxSize=CGSizeMake(MAX(_minSize.width,_maxSize.width),MAX(_minSize.height,_maxSize.height));
}
}),new objj_method(sel_getUid("maxSize"),function(_47,_48){
with(_47){
return _maxSize;
}
}),new objj_method(sel_getUid("setMaxSize:"),function(_49,_4a,_4b){
with(_49){
if(!_4b.height||!_4b.width){
return;
}
_maxSize=CGSizeMakeCopy(_4b);
_minSize=CGSizeMake(MIN(_minSize.width,_maxSize.width),MIN(_minSize.height,_maxSize.height));
}
}),new objj_method(sel_getUid("visibilityPriority"),function(_4c,_4d){
with(_4c){
return _visibilityPriority;
}
}),new objj_method(sel_getUid("setVisibilityPriority:"),function(_4e,_4f,_50){
with(_4e){
_visibilityPriority=_50;
}
}),new objj_method(sel_getUid("validate"),function(_51,_52){
with(_51){
if(_view){
if(objj_msgSend(_53,"respondsToSelector:",sel_getUid("validateToolbarItem:"))){
objj_msgSend(_51,"setEnabled:",objj_msgSend(_53,"validateToolbarItem:",_51));
}
return;
}
var _54=objj_msgSend(_51,"action");
if(!_54){
return objj_msgSend(_51,"setEnabled:",NO);
}
var _53=objj_msgSend(_51,"target");
if(_53&&!objj_msgSend(_53,"respondsToSelector:",_54)){
return objj_msgSend(_51,"setEnabled:",NO);
}
_53=objj_msgSend(CPApp,"targetForAction:to:from:",_54,_53,_51);
if(!_53){
return objj_msgSend(_51,"setEnabled:",NO);
}
if(objj_msgSend(_53,"respondsToSelector:",sel_getUid("validateToolbarItem:"))){
objj_msgSend(_51,"setEnabled:",objj_msgSend(_53,"validateToolbarItem:",_51));
}else{
objj_msgSend(_51,"setEnabled:",YES);
}
}
}),new objj_method(sel_getUid("autovalidates"),function(_55,_56){
with(_55){
return _autovalidates;
}
}),new objj_method(sel_getUid("setAutovalidates:"),function(_57,_58,_59){
with(_57){
_autovalidates=!!_59;
}
})]);
var _5a="CPToolbarItemItemIdentifierKey",_5b="CPToolbarItemLabelKey",_5c="CPToolbarItemPaletteLabelKey",_5d="CPToolbarItemToolTipKey",_5e="CPToolbarItemTagKey",_5f="CPToolbarItemTargetKey",_60="CPToolbarItemActionKey",_61="CPToolbarItemEnabledKey",_62="CPToolbarItemImageKey",_63="CPToolbarItemAlternateImageKey",_64="CPToolbarItemViewKey",_65="CPToolbarItemMinSizeKey",_66="CPToolbarItemMaxSizeKey",_67="CPToolbarItemVisibilityPriorityKey",_68="CPToolbarItemAutovalidatesKey";
var _1=objj_getClass("CPToolbarItem");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPToolbarItem\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_69,_6a,_6b){
with(_69){
_69=objj_msgSendSuper({receiver:_69,super_class:objj_getClass("CPToolbarItem").super_class},"init");
if(_69){
_itemIdentifier=objj_msgSend(_6b,"decodeObjectForKey:",_5a);
_minSize=objj_msgSend(_6b,"decodeSizeForKey:",_65);
_maxSize=objj_msgSend(_6b,"decodeSizeForKey:",_66);
objj_msgSend(_69,"setLabel:",objj_msgSend(_6b,"decodeObjectForKey:",_5b));
objj_msgSend(_69,"setPaletteLabel:",objj_msgSend(_6b,"decodeObjectForKey:",_5c));
objj_msgSend(_69,"setToolTip:",objj_msgSend(_6b,"decodeObjectForKey:",_5d));
objj_msgSend(_69,"setTag:",objj_msgSend(_6b,"decodeObjectForKey:",_5e));
objj_msgSend(_69,"setTarget:",objj_msgSend(_6b,"decodeObjectForKey:",_5f));
objj_msgSend(_69,"setAction:",CPSelectorFromString(objj_msgSend(_6b,"decodeObjectForKey:",_60)));
objj_msgSend(_69,"setEnabled:",objj_msgSend(_6b,"decodeBoolForKey:",_61));
objj_msgSend(_69,"setImage:",objj_msgSend(_6b,"decodeObjectForKey:",_62));
objj_msgSend(_69,"setAlternateImage:",objj_msgSend(_6b,"decodeObjectForKey:",_63));
objj_msgSend(_69,"setView:",objj_msgSend(_6b,"decodeObjectForKey:",_64));
objj_msgSend(_69,"setVisibilityPriority:",objj_msgSend(_6b,"decodeIntForKey:",_67));
objj_msgSend(_69,"setAutovalidates:",objj_msgSend(_6b,"decodeBoolForKey:",_68));
}
return _69;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_6c,_6d,_6e){
with(_6c){
objj_msgSend(_6e,"encodeObject:forKey:",_itemIdentifier,_5a);
objj_msgSend(_6e,"encodeObject:forKey:",objj_msgSend(_6c,"label"),_5b);
objj_msgSend(_6e,"encodeObject:forKey:",objj_msgSend(_6c,"paletteLabel"),_5c);
objj_msgSend(_6e,"encodeObject:forKey:",objj_msgSend(_6c,"toolTip"),_5d);
objj_msgSend(_6e,"encodeObject:forKey:",objj_msgSend(_6c,"tag"),_5e);
objj_msgSend(_6e,"encodeObject:forKey:",objj_msgSend(_6c,"target"),_5f);
objj_msgSend(_6e,"encodeObject:forKey:",objj_msgSend(_6c,"action"),_60);
objj_msgSend(_6e,"encodeObject:forKey:",objj_msgSend(_6c,"isEnabled"),_61);
objj_msgSend(_6e,"encodeObject:forKey:",objj_msgSend(_6c,"image"),_62);
objj_msgSend(_6e,"encodeObject:forKey:",objj_msgSend(_6c,"alternateImage"),_63);
objj_msgSend(_6e,"encodeObject:forKey:",objj_msgSend(_6c,"view"),_64);
objj_msgSend(_6e,"encodeSize:forKey:",objj_msgSend(_6c,"minSize"),_65);
objj_msgSend(_6e,"encodeSize:forKey:",objj_msgSend(_6c,"maxSize"),_66);
objj_msgSend(_6e,"encodeObject:forKey:",objj_msgSend(_6c,"visibilityPriority"),_67);
objj_msgSend(_6e,"encodeBool:forKey:",objj_msgSend(_6c,"autovalidates"),_68);
}
})]);
var _1=objj_getClass("CPToolbarItem");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPToolbarItem\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("copy"),function(_6f,_70){
with(_6f){
var _71=objj_msgSend(objj_msgSend(objj_msgSend(_6f,"class"),"alloc"),"initWithItemIdentifier:",_itemIdentifier);
if(_view){
objj_msgSend(_71,"setView:",objj_msgSend(CPKeyedUnarchiver,"unarchiveObjectWithData:",objj_msgSend(CPKeyedArchiver,"archivedDataWithRootObject:",_view)));
}
objj_msgSend(_71,"_setToolbar:",_toolbar);
objj_msgSend(_71,"setLabel:",_label);
objj_msgSend(_71,"setPaletteLabel:",_paletteLabel);
objj_msgSend(_71,"setToolTip:",objj_msgSend(_6f,"toolTip"));
objj_msgSend(_71,"setTag:",objj_msgSend(_6f,"tag"));
objj_msgSend(_71,"setTarget:",objj_msgSend(_6f,"target"));
objj_msgSend(_71,"setAction:",objj_msgSend(_6f,"action"));
objj_msgSend(_71,"setEnabled:",objj_msgSend(_6f,"isEnabled"));
objj_msgSend(_71,"setImage:",objj_msgSend(_6f,"image"));
objj_msgSend(_71,"setAlternateImage:",objj_msgSend(_6f,"alternateImage"));
objj_msgSend(_71,"setMinSize:",_minSize);
objj_msgSend(_71,"setMaxSize:",_maxSize);
objj_msgSend(_71,"setVisibilityPriority:",objj_msgSend(_6f,"visibilityPriority"));
objj_msgSend(_71,"setAutovalidates:",objj_msgSend(_6f,"autovalidates"));
return _71;
}
})]);
var _1=objj_getClass("CPToolbarItem");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPToolbarItem\"");
}
var _2=_1.isa;
class_addMethods(_2,[new objj_method(sel_getUid("_standardItemWithItemIdentifier:"),function(_72,_73,_74){
with(_72){
switch(_74){
case CPToolbarSeparatorItemIdentifier:
return objj_msgSend(_CPToolbarSeparatorItem,"new");
case CPToolbarSpaceItemIdentifier:
return objj_msgSend(_CPToolbarSpaceItem,"new");
case CPToolbarFlexibleSpaceItemIdentifier:
return objj_msgSend(_CPToolbarFlexibleSpaceItem,"new");
case CPToolbarShowColorsItemIdentifier:
return objj_msgSend(_CPToolbarShowColorsItem,"new");
case CPToolbarShowFontsItemIdentifier:
return nil;
case CPToolbarCustomizeToolbarItemIdentifier:
return nil;
case CPToolbarPrintItemIdentifier:
return nil;
}
return nil;
}
})]);
objj_executeFile("_CPToolbarFlexibleSpaceItem.j",YES);
objj_executeFile("_CPToolbarShowColorsItem.j",YES);
objj_executeFile("_CPToolbarSeparatorItem.j",YES);
objj_executeFile("_CPToolbarSpaceItem.j",YES);
p;12;CPTreeNode.jt;3517;@STATIC;1.0;I;21;Foundation/CPObject.jt;3472;
objj_executeFile("Foundation/CPObject.j",NO);
var _1=objj_allocateClassPair(CPObject,"CPTreeNode"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_representedObject"),new objj_ivar("_parentNode"),new objj_ivar("_childNodes")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("representedObject"),function(_3,_4){
with(_3){
return _representedObject;
}
}),new objj_method(sel_getUid("parentNode"),function(_5,_6){
with(_5){
return _parentNode;
}
}),new objj_method(sel_getUid("initWithRepresentedObject:"),function(_7,_8,_9){
with(_7){
_7=objj_msgSendSuper({receiver:_7,super_class:objj_getClass("CPTreeNode").super_class},"init");
if(_7){
_representedObject=_9;
_childNodes=[];
}
return _7;
}
}),new objj_method(sel_getUid("isLeaf"),function(_a,_b){
with(_a){
return objj_msgSend(_childNodes,"count")<=0;
}
}),new objj_method(sel_getUid("childNodes"),function(_c,_d){
with(_c){
return objj_msgSend(_childNodes,"copy");
}
}),new objj_method(sel_getUid("mutableChildNodes"),function(_e,_f){
with(_e){
return objj_msgSend(_e,"mutableArrayValueForKey:","childNodes");
}
}),new objj_method(sel_getUid("insertObject:inChildNodesAtIndex:"),function(_10,_11,_12,_13){
with(_10){
objj_msgSend(objj_msgSend(_12._parentNode,"mutableChildNodes"),"removeObjectIdenticalTo:",_12);
_12._parentNode=_10;
objj_msgSend(_childNodes,"insertObject:atIndex:",_12,_13);
}
}),new objj_method(sel_getUid("removeObjectFromChildNodesAtIndex:"),function(_14,_15,_16){
with(_14){
objj_msgSend(_childNodes,"objectAtIndex:",_16)._parentNode=nil;
objj_msgSend(_childNodes,"removeObjectAtIndex:",_16);
}
}),new objj_method(sel_getUid("replaceObjectFromChildNodesAtIndex:withObject:"),function(_17,_18,_19,_1a){
with(_17){
var _1b=objj_msgSend(_childNodes,"objectAtIndex:",_19);
_1b._parentNode=nil;
_1a._parentNode=_17;
objj_msgSend(_childNodes,"replaceObjectAtIndex:withObject:",_19,_1a);
}
}),new objj_method(sel_getUid("objectInChildNodesAtIndex:"),function(_1c,_1d,_1e){
with(_1c){
return _childNodes[_1e];
}
}),new objj_method(sel_getUid("sortWithSortDescriptors:recursively:"),function(_1f,_20,_21,_22){
with(_1f){
objj_msgSend(_childNodes,"sortUsingDescriptors:",_21);
if(!_22){
return;
}
var _23=objj_msgSend(_childNodes,"count");
while(_23--){
objj_msgSend(_childNodes[_23],"sortWithSortDescriptors:recursively:",_21,YES);
}
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("treeNodeWithRepresentedObject:"),function(_24,_25,_26){
with(_24){
return objj_msgSend(objj_msgSend(_24,"alloc"),"initWithRepresentedObject:",_26);
}
})]);
var _27="CPTreeNodeRepresentedObjectKey",_28="CPTreeNodeParentNodeKey",_29="CPTreeNodeChildNodesKey";
var _1=objj_getClass("CPTreeNode");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPTreeNode\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_2a,_2b,_2c){
with(_2a){
_2a=objj_msgSendSuper({receiver:_2a,super_class:objj_getClass("CPTreeNode").super_class},"init");
if(_2a){
_representedObject=objj_msgSend(_2c,"decodeObjectForKey:",_27);
_parentNode=objj_msgSend(_2c,"decodeObjectForKey:",_28);
_childNodes=objj_msgSend(_2c,"decodeObjectForKey:",_29);
}
return _2a;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_2d,_2e,_2f){
with(_2d){
objj_msgSend(_2f,"encodeObject:forKey:",_representedObject,_27);
objj_msgSend(_2f,"encodeConditionalObject:forKey:",_parentNode,_28);
objj_msgSend(_2f,"encodeObject:forKey:",_childNodes,_29);
}
})]);
p;8;CPView.jt;58088;@STATIC;1.0;I;20;Foundation/CPArray.jI;26;Foundation/CPObjJRuntime.ji;19;CGAffineTransform.ji;12;CGGeometry.ji;9;CPColor.ji;12;CPGeometry.ji;19;CPGraphicsContext.ji;13;CPResponder.ji;9;CPTheme.ji;18;_CPDisplayServer.jt;57863;
objj_executeFile("Foundation/CPArray.j",NO);
objj_executeFile("Foundation/CPObjJRuntime.j",NO);
objj_executeFile("CGAffineTransform.j",YES);
objj_executeFile("CGGeometry.j",YES);
objj_executeFile("CPColor.j",YES);
objj_executeFile("CPGeometry.j",YES);
objj_executeFile("CPGraphicsContext.j",YES);
objj_executeFile("CPResponder.j",YES);
objj_executeFile("CPTheme.j",YES);
objj_executeFile("_CPDisplayServer.j",YES);
CPViewNotSizable=0;
CPViewMinXMargin=1;
CPViewWidthSizable=2;
CPViewMaxXMargin=4;
CPViewMinYMargin=8;
CPViewHeightSizable=16;
CPViewMaxYMargin=32;
CPViewBoundsDidChangeNotification="CPViewBoundsDidChangeNotification";
CPViewFrameDidChangeNotification="CPViewFrameDidChangeNotification";
var _1=nil,_2=nil;
var _3=nil,_4=0,_5=1,_6=2,_7=3;
var _8={},_9=1<<0,_a=1<<1;
var _b=objj_allocateClassPair(CPResponder,"CPView"),_c=_b.isa;
class_addIvars(_b,[new objj_ivar("_window"),new objj_ivar("_superview"),new objj_ivar("_subviews"),new objj_ivar("_graphicsContext"),new objj_ivar("_tag"),new objj_ivar("_frame"),new objj_ivar("_bounds"),new objj_ivar("_boundsTransform"),new objj_ivar("_inverseBoundsTransform"),new objj_ivar("_registeredDraggedTypes"),new objj_ivar("_registeredDraggedTypesArray"),new objj_ivar("_isHidden"),new objj_ivar("_hitTests"),new objj_ivar("_postsFrameChangedNotifications"),new objj_ivar("_postsBoundsChangedNotifications"),new objj_ivar("_inhibitFrameAndBoundsChangedNotifications"),new objj_ivar("_DOMElement"),new objj_ivar("_DOMContentsElement"),new objj_ivar("_DOMImageParts"),new objj_ivar("_DOMImageSizes"),new objj_ivar("_backgroundType"),new objj_ivar("_dirtyRect"),new objj_ivar("_opacity"),new objj_ivar("_backgroundColor"),new objj_ivar("_autoresizesSubviews"),new objj_ivar("_autoresizingMask"),new objj_ivar("_layer"),new objj_ivar("_wantsLayer"),new objj_ivar("_isInFullScreenMode"),new objj_ivar("_fullScreenModeState"),new objj_ivar("_needsLayout"),new objj_ivar("_ephemeralSubviews"),new objj_ivar("_theme"),new objj_ivar("_themeAttributes"),new objj_ivar("_themeState"),new objj_ivar("_ephemeralSubviewsForNames"),new objj_ivar("_ephereralSubviews"),new objj_ivar("_nextKeyView"),new objj_ivar("_previousKeyView"),new objj_ivar("_viewClassFlags")]);
objj_registerClassPair(_b);
class_addMethods(_b,[new objj_method(sel_getUid("setupViewFlags"),function(_d,_e){
with(_d){
var _f=objj_msgSend(_d,"class"),_10=objj_msgSend(_f,"UID");
if(_8[_10]===undefined){
var _11=0;
if(objj_msgSend(_f,"instanceMethodForSelector:",sel_getUid("drawRect:"))!==objj_msgSend(CPView,"instanceMethodForSelector:",sel_getUid("drawRect:"))){
_11|=_9;
}
if(objj_msgSend(_f,"instanceMethodForSelector:",sel_getUid("layoutSubviews"))!==objj_msgSend(CPView,"instanceMethodForSelector:",sel_getUid("layoutSubviews"))){
_11|=_a;
}
_8[_10]=_11;
}
_viewClassFlags=_8[_10];
}
}),new objj_method(sel_getUid("init"),function(_12,_13){
with(_12){
return objj_msgSend(_12,"initWithFrame:",CGRectMakeZero());
}
}),new objj_method(sel_getUid("initWithFrame:"),function(_14,_15,_16){
with(_14){
_14=objj_msgSendSuper({receiver:_14,super_class:objj_getClass("CPView").super_class},"init");
if(_14){
var _17=(_16.size.width),_18=(_16.size.height);
_subviews=[];
_registeredDraggedTypes=objj_msgSend(CPSet,"set");
_registeredDraggedTypesArray=[];
_tag=-1;
_frame={origin:{x:_16.origin.x,y:_16.origin.y},size:{width:_16.size.width,height:_16.size.height}};
_bounds={origin:{x:0,y:0},size:{width:_17,height:_18}};
_autoresizingMask=CPViewNotSizable;
_autoresizesSubviews=YES;
_opacity=1;
_isHidden=NO;
_hitTests=YES;
_DOMElement=_3.cloneNode(false);
if(NULL){
var _19={x:CGPointMake((_16.origin.x),(_16.origin.y)).x*NULL.a+CGPointMake((_16.origin.x),(_16.origin.y)).y*NULL.c+NULL.tx,y:CGPointMake((_16.origin.x),(_16.origin.y)).x*NULL.b+CGPointMake((_16.origin.x),(_16.origin.y)).y*NULL.d+NULL.ty};
}else{
var _19={x:(_16.origin.x),y:(_16.origin.y)};
}
_DOMElement.style.left=ROUND(_19.x)+"px";
_DOMElement.style.top=ROUND(_19.y)+"px";
_DOMElement.style.width=MAX(0,ROUND(_17))+"px";
_DOMElement.style.height=MAX(0,ROUND(_18))+"px";
_DOMImageParts=[];
_DOMImageSizes=[];
_theme=objj_msgSend(CPTheme,"defaultTheme");
_themeState=CPThemeStateNormal;
objj_msgSend(_14,"setupViewFlags");
objj_msgSend(_14,"_loadThemeAttributes");
}
return _14;
}
}),new objj_method(sel_getUid("superview"),function(_1a,_1b){
with(_1a){
return _superview;
}
}),new objj_method(sel_getUid("subviews"),function(_1c,_1d){
with(_1c){
return objj_msgSend(_subviews,"copy");
}
}),new objj_method(sel_getUid("window"),function(_1e,_1f){
with(_1e){
return _window;
}
}),new objj_method(sel_getUid("addSubview:"),function(_20,_21,_22){
with(_20){
objj_msgSend(_20,"_insertSubview:atIndex:",_22,CPNotFound);
}
}),new objj_method(sel_getUid("addSubview:positioned:relativeTo:"),function(_23,_24,_25,_26,_27){
with(_23){
var _28=_27?objj_msgSend(_subviews,"indexOfObjectIdenticalTo:",_27):CPNotFound;
if(_28===CPNotFound){
_28=(_26===CPWindowAbove)?objj_msgSend(_subviews,"count"):0;
}else{
if(_26===CPWindowAbove){
++_28;
}
}
objj_msgSend(_23,"_insertSubview:atIndex:",_25,_28);
}
}),new objj_method(sel_getUid("_insertSubview:atIndex:"),function(_29,_2a,_2b,_2c){
with(_29){
var _2d=_subviews.length;
objj_msgSend(objj_msgSend(_29,"window"),"_dirtyKeyViewLoop");
if(_2b._superview==_29){
var _2e=objj_msgSend(_subviews,"indexOfObjectIdenticalTo:",_2b);
if(_2e===_2c||_2e===_2d-1&&_2c===_2d){
return;
}
objj_msgSend(_subviews,"removeObjectAtIndex:",_2e);
_DOMElement.removeChild(_2b._DOMElement);
if(_2c>_2e){
--_2c;
}
--_2d;
}else{
objj_msgSend(_2b,"removeFromSuperview");
objj_msgSend(_2b,"_setWindow:",_window);
objj_msgSend(_2b,"viewWillMoveToSuperview:",_29);
_2b._superview=_29;
}
if(_2c===CPNotFound||_2c>=_2d){
_subviews.push(_2b);
_DOMElement.appendChild(_2b._DOMElement);
}else{
_subviews.splice(_2c,0,_2b);
_DOMElement.insertBefore(_2b._DOMElement,_subviews[_2c+1]._DOMElement);
}
objj_msgSend(_2b,"setNextResponder:",_29);
objj_msgSend(_2b,"viewDidMoveToSuperview");
objj_msgSend(_29,"didAddSubview:",_2b);
}
}),new objj_method(sel_getUid("didAddSubview:"),function(_2f,_30,_31){
with(_2f){
}
}),new objj_method(sel_getUid("removeFromSuperview"),function(_32,_33){
with(_32){
if(!_superview){
return;
}
objj_msgSend(objj_msgSend(_32,"window"),"_dirtyKeyViewLoop");
objj_msgSend(_superview,"willRemoveSubview:",_32);
objj_msgSend(_superview._subviews,"removeObject:",_32);
_superview._DOMElement.removeChild(_DOMElement);
_superview=nil;
objj_msgSend(_32,"_setWindow:",nil);
}
}),new objj_method(sel_getUid("replaceSubview:with:"),function(_34,_35,_36,_37){
with(_34){
if(_36._superview!=_34){
return;
}
var _38=objj_msgSend(_subviews,"indexOfObjectIdenticalTo:",_36);
objj_msgSend(_36,"removeFromSuperview");
objj_msgSend(_34,"_insertSubview:atIndex:",_37,_38);
}
}),new objj_method(sel_getUid("setSubviews:"),function(_39,_3a,_3b){
with(_39){
if(!_3b){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"newSubviews cannot be nil in -[CPView setSubviews:]");
}
if(objj_msgSend(_subviews,"isEqual:",_3b)){
return;
}
if(objj_msgSend(_subviews,"count")===0){
var _3c=0,_3d=objj_msgSend(_3b,"count");
for(;_3c<_3d;++_3c){
objj_msgSend(_39,"addSubview:",_3b[_3c]);
}
return;
}
if(objj_msgSend(_3b,"count")===0){
var _3d=objj_msgSend(_subviews,"count");
while(_3d--){
objj_msgSend(_subviews[_3d],"removeFromSuperview");
}
return;
}
var _3e=objj_msgSend(CPMutableSet,"setWithArray:",_subviews);
objj_msgSend(_3e,"removeObjectsInArray:",_3b);
objj_msgSend(_3e,"makeObjectsPerformSelector:",sel_getUid("removeFromSuperview"));
var _3f=objj_msgSend(CPMutableSet,"setWithArray:",_3b);
objj_msgSend(_3f,"removeObjectsInArray:",_subviews);
var _40=nil,_41=objj_msgSend(_3f,"objectEnumerator");
while(_40=objj_msgSend(_41,"nextObject")){
objj_msgSend(_39,"addSubview:",_40);
}
if(objj_msgSend(_subviews,"isEqual:",_3b)){
return;
}
_subviews=objj_msgSend(_3b,"copy");
var _3c=0,_3d=objj_msgSend(_subviews,"count");
for(;_3c<_3d;++_3c){
var _42=_subviews[_3c];
_DOMElement.removeChild(_42._DOMElement);
_DOMElement.appendChild(_42._DOMElement);
}
}
}),new objj_method(sel_getUid("_setWindow:"),function(_43,_44,_45){
with(_43){
if(_window===_45){
return;
}
objj_msgSend(objj_msgSend(_43,"window"),"_dirtyKeyViewLoop");
if(objj_msgSend(_window,"firstResponder")===_43){
objj_msgSend(_window,"makeFirstResponder:",nil);
}
objj_msgSend(_43,"viewWillMoveToWindow:",_45);
if(_registeredDraggedTypes){
objj_msgSend(_window,"_noteUnregisteredDraggedTypes:",_registeredDraggedTypes);
objj_msgSend(_45,"_noteRegisteredDraggedTypes:",_registeredDraggedTypes);
}
_window=_45;
var _46=objj_msgSend(_subviews,"count");
while(_46--){
objj_msgSend(_subviews[_46],"_setWindow:",_45);
}
objj_msgSend(_43,"viewDidMoveToWindow");
objj_msgSend(objj_msgSend(_43,"window"),"_dirtyKeyViewLoop");
}
}),new objj_method(sel_getUid("isDescendantOf:"),function(_47,_48,_49){
with(_47){
var _4a=_47;
do{
if(_4a==_49){
return YES;
}
}while(_4a=objj_msgSend(_4a,"superview"));
return NO;
}
}),new objj_method(sel_getUid("viewDidMoveToSuperview"),function(_4b,_4c){
with(_4b){
objj_msgSend(_4b,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("viewDidMoveToWindow"),function(_4d,_4e){
with(_4d){
}
}),new objj_method(sel_getUid("viewWillMoveToSuperview:"),function(_4f,_50,_51){
with(_4f){
}
}),new objj_method(sel_getUid("viewWillMoveToWindow:"),function(_52,_53,_54){
with(_52){
}
}),new objj_method(sel_getUid("willRemoveSubview:"),function(_55,_56,_57){
with(_55){
}
}),new objj_method(sel_getUid("enclosingMenuItem"),function(_58,_59){
with(_58){
var _5a=_58;
while(_5a&&!objj_msgSend(_5a,"isKindOfClass:",objj_msgSend(_CPMenuItemView,"class"))){
_5a=objj_msgSend(_5a,"superview");
}
if(_5a){
return _5a._menuItem;
}
return nil;
}
}),new objj_method(sel_getUid("setTag:"),function(_5b,_5c,_5d){
with(_5b){
_tag=_5d;
}
}),new objj_method(sel_getUid("tag"),function(_5e,_5f){
with(_5e){
return _tag;
}
}),new objj_method(sel_getUid("viewWithTag:"),function(_60,_61,_62){
with(_60){
if(objj_msgSend(_60,"tag")==_62){
return _60;
}
var _63=0,_64=_subviews.length;
for(;_63<_64;++_63){
var _65=objj_msgSend(_subviews[_63],"viewWithTag:",_62);
if(_65){
return _65;
}
}
return nil;
}
}),new objj_method(sel_getUid("isFlipped"),function(_66,_67){
with(_66){
return YES;
}
}),new objj_method(sel_getUid("setFrame:"),function(_68,_69,_6a){
with(_68){
if(((_frame.origin.x==_6a.origin.x&&_frame.origin.y==_6a.origin.y)&&(_frame.size.width==_6a.size.width&&_frame.size.height==_6a.size.height))){
return;
}
_inhibitFrameAndBoundsChangedNotifications=YES;
objj_msgSend(_68,"setFrameOrigin:",_6a.origin);
objj_msgSend(_68,"setFrameSize:",_6a.size);
_inhibitFrameAndBoundsChangedNotifications=NO;
if(_postsFrameChangedNotifications){
objj_msgSend(_1,"postNotificationName:object:",CPViewFrameDidChangeNotification,_68);
}
}
}),new objj_method(sel_getUid("frame"),function(_6b,_6c){
with(_6b){
return {origin:{x:_frame.origin.x,y:_frame.origin.y},size:{width:_frame.size.width,height:_frame.size.height}};
}
}),new objj_method(sel_getUid("frameOrigin"),function(_6d,_6e){
with(_6d){
return {x:_frame.origin.x,y:_frame.origin.y};
}
}),new objj_method(sel_getUid("frameSize"),function(_6f,_70){
with(_6f){
return {width:_frame.size.width,height:_frame.size.height};
}
}),new objj_method(sel_getUid("setCenter:"),function(_71,_72,_73){
with(_71){
objj_msgSend(_71,"setFrameOrigin:",CGPointMake(_73.x-_frame.size.width/2,_73.y-_frame.size.height/2));
}
}),new objj_method(sel_getUid("center"),function(_74,_75){
with(_74){
return CGPointMake(_frame.size.width/2+_frame.origin.x,_frame.size.height/2+_frame.origin.y);
}
}),new objj_method(sel_getUid("setFrameOrigin:"),function(_76,_77,_78){
with(_76){
var _79=_frame.origin;
if(!_78||(_79.x==_78.x&&_79.y==_78.y)){
return;
}
_79.x=_78.x;
_79.y=_78.y;
if(_postsFrameChangedNotifications&&!_inhibitFrameAndBoundsChangedNotifications){
objj_msgSend(_1,"postNotificationName:object:",CPViewFrameDidChangeNotification,_76);
}
var _7a=_superview?_superview._boundsTransform:NULL;
if(_7a){
var _7b={x:CGPointMake(_79.x,_79.y).x*_7a.a+CGPointMake(_79.x,_79.y).y*_7a.c+_7a.tx,y:CGPointMake(_79.x,_79.y).x*_7a.b+CGPointMake(_79.x,_79.y).y*_7a.d+_7a.ty};
}else{
var _7b={x:_79.x,y:_79.y};
}
_DOMElement.style.left=ROUND(_7b.x)+"px";
_DOMElement.style.top=ROUND(_7b.y)+"px";
}
}),new objj_method(sel_getUid("setFrameSize:"),function(_7c,_7d,_7e){
with(_7c){
var _7f=_frame.size;
if(!_7e||(_7f.width==_7e.width&&_7f.height==_7e.height)){
return;
}
var _80={width:_7f.width,height:_7f.height};
_7f.width=_7e.width;
_7f.height=_7e.height;
if(YES){
_bounds.size.width=_7e.width;
_bounds.size.height=_7e.height;
}
if(_layer){
objj_msgSend(_layer,"_owningViewBoundsChanged");
}
if(_autoresizesSubviews){
objj_msgSend(_7c,"resizeSubviewsWithOldSize:",_80);
}
objj_msgSend(_7c,"setNeedsLayout");
objj_msgSend(_7c,"setNeedsDisplay:",YES);
_DOMElement.style.width=MAX(0,ROUND(_7f.width))+"px";
_DOMElement.style.height=MAX(0,ROUND(_7f.height))+"px";
if(_DOMContentsElement){
_DOMContentsElement.width=MAX(0,ROUND(_7f.width));
_DOMContentsElement.height=MAX(0,ROUND(_7f.height));
_DOMContentsElement.style.width=MAX(0,ROUND(_7f.width))+"px";
_DOMContentsElement.style.height=MAX(0,ROUND(_7f.height))+"px";
}
if(_backgroundType!==_4){
var _81=objj_msgSend(objj_msgSend(_backgroundColor,"patternImage"),"imageSlices");
if(_backgroundType===_5){
_DOMImageParts[1].style.width=MAX(0,ROUND(_7f.width))+"px";
_DOMImageParts[1].style.height=MAX(0,ROUND(_7f.height-_DOMImageSizes[0].height-_DOMImageSizes[2].height))+"px";
}else{
if(_backgroundType===_6){
_DOMImageParts[1].style.width=MAX(0,ROUND(_7f.width-_DOMImageSizes[0].width-_DOMImageSizes[2].width))+"px";
_DOMImageParts[1].style.height=MAX(0,ROUND(_7f.height))+"px";
}else{
if(_backgroundType===_7){
var _82=_7f.width-_DOMImageSizes[0].width-_DOMImageSizes[2].width,_83=_7f.height-_DOMImageSizes[0].height-_DOMImageSizes[6].height;
_DOMImageParts[1].style.width=MAX(0,ROUND(_82))+"px";
_DOMImageParts[1].style.height=MAX(0,ROUND(_DOMImageSizes[0].height))+"px";
_DOMImageParts[3].style.width=MAX(0,ROUND(_DOMImageSizes[3].width))+"px";
_DOMImageParts[3].style.height=MAX(0,ROUND(_83))+"px";
_DOMImageParts[4].style.width=MAX(0,ROUND(_82))+"px";
_DOMImageParts[4].style.height=MAX(0,ROUND(_83))+"px";
_DOMImageParts[5].style.width=MAX(0,ROUND(_DOMImageSizes[5].width))+"px";
_DOMImageParts[5].style.height=MAX(0,ROUND(_83))+"px";
_DOMImageParts[7].style.width=MAX(0,ROUND(_82))+"px";
_DOMImageParts[7].style.height=MAX(0,ROUND(_DOMImageSizes[7].height))+"px";
}
}
}
}
if(_postsFrameChangedNotifications&&!_inhibitFrameAndBoundsChangedNotifications){
objj_msgSend(_1,"postNotificationName:object:",CPViewFrameDidChangeNotification,_7c);
}
}
}),new objj_method(sel_getUid("setBounds:"),function(_84,_85,_86){
with(_84){
if(((_bounds.origin.x==_86.origin.x&&_bounds.origin.y==_86.origin.y)&&(_bounds.size.width==_86.size.width&&_bounds.size.height==_86.size.height))){
return;
}
_inhibitFrameAndBoundsChangedNotifications=YES;
objj_msgSend(_84,"setBoundsOrigin:",_86.origin);
objj_msgSend(_84,"setBoundsSize:",_86.size);
_inhibitFrameAndBoundsChangedNotifications=NO;
if(_postsBoundsChangedNotifications){
objj_msgSend(_1,"postNotificationName:object:",CPViewBoundsDidChangeNotification,_84);
}
}
}),new objj_method(sel_getUid("bounds"),function(_87,_88){
with(_87){
return {origin:{x:_bounds.origin.x,y:_bounds.origin.y},size:{width:_bounds.size.width,height:_bounds.size.height}};
}
}),new objj_method(sel_getUid("boundsOrigin"),function(_89,_8a){
with(_89){
return {x:_bounds.origin.x,y:_bounds.origin.y};
}
}),new objj_method(sel_getUid("boundsSize"),function(_8b,_8c){
with(_8b){
return {width:_bounds.size.width,height:_bounds.size.height};
}
}),new objj_method(sel_getUid("setBoundsOrigin:"),function(_8d,_8e,_8f){
with(_8d){
var _90=_bounds.origin;
if((_90.x==_8f.x&&_90.y==_8f.y)){
return;
}
_90.x=_8f.x;
_90.y=_8f.y;
if(_90.x!=0||_90.y!=0){
_boundsTransform={a:1,b:0,c:0,d:1,tx:-_90.x,ty:-_90.y};
_inverseBoundsTransform=CGAffineTransformInvert(_boundsTransform);
}else{
_boundsTransform=nil;
_inverseBoundsTransform=nil;
}
var _91=_subviews.length;
while(_91--){
var _92=_subviews[_91],_90=_92._frame.origin;
if(_boundsTransform){
var _93={x:CGPointMake(_90.x,_90.y).x*_boundsTransform.a+CGPointMake(_90.x,_90.y).y*_boundsTransform.c+_boundsTransform.tx,y:CGPointMake(_90.x,_90.y).x*_boundsTransform.b+CGPointMake(_90.x,_90.y).y*_boundsTransform.d+_boundsTransform.ty};
}else{
var _93={x:_90.x,y:_90.y};
}
_92._DOMElement.style.left=ROUND(_93.x)+"px";
_92._DOMElement.style.top=ROUND(_93.y)+"px";
}
if(_postsBoundsChangedNotifications&&!_inhibitFrameAndBoundsChangedNotifications){
objj_msgSend(_1,"postNotificationName:object:",CPViewBoundsDidChangeNotification,_8d);
}
}
}),new objj_method(sel_getUid("setBoundsSize:"),function(_94,_95,_96){
with(_94){
var _97=_bounds.size;
if((_97.width==_96.width&&_97.height==_96.height)){
return;
}
var _98=_frame.size;
if(!(_97.width==_98.width&&_97.height==_98.height)){
var _99=_bounds.origin;
_99.x/=_97.width/_98.width;
_99.y/=_97.height/_98.height;
}
_97.width=_96.width;
_97.height=_96.height;
if(!(_97.width==_98.width&&_97.height==_98.height)){
var _99=_bounds.origin;
_99.x*=_97.width/_98.width;
_99.y*=_97.height/_98.height;
}
if(_postsBoundsChangedNotifications&&!_inhibitFrameAndBoundsChangedNotifications){
objj_msgSend(_1,"postNotificationName:object:",CPViewBoundsDidChangeNotification,_94);
}
}
}),new objj_method(sel_getUid("resizeWithOldSuperviewSize:"),function(_9a,_9b,_9c){
with(_9a){
var _9d=objj_msgSend(_9a,"autoresizingMask");
if(_9d==CPViewNotSizable){
return;
}
var _9e=_superview._frame,_9f={origin:{x:_frame.origin.x,y:_frame.origin.y},size:{width:_frame.size.width,height:_frame.size.height}},dX=((_9e.size.width)-_9c.width)/(((_9d&CPViewMinXMargin)?1:0)+(_9d&CPViewWidthSizable?1:0)+(_9d&CPViewMaxXMargin?1:0)),dY=((_9e.size.height)-_9c.height)/((_9d&CPViewMinYMargin?1:0)+(_9d&CPViewHeightSizable?1:0)+(_9d&CPViewMaxYMargin?1:0));
if(_9d&CPViewMinXMargin){
_9f.origin.x+=dX;
}
if(_9d&CPViewWidthSizable){
_9f.size.width+=dX;
}
if(_9d&CPViewMinYMargin){
_9f.origin.y+=dY;
}
if(_9d&CPViewHeightSizable){
_9f.size.height+=dY;
}
objj_msgSend(_9a,"setFrame:",_9f);
}
}),new objj_method(sel_getUid("resizeSubviewsWithOldSize:"),function(_a0,_a1,_a2){
with(_a0){
var _a3=_subviews.length;
while(_a3--){
objj_msgSend(_subviews[_a3],"resizeWithOldSuperviewSize:",_a2);
}
}
}),new objj_method(sel_getUid("setAutoresizesSubviews:"),function(_a4,_a5,_a6){
with(_a4){
_autoresizesSubviews=!!_a6;
}
}),new objj_method(sel_getUid("autoresizesSubviews"),function(_a7,_a8){
with(_a7){
return _autoresizesSubviews;
}
}),new objj_method(sel_getUid("setAutoresizingMask:"),function(_a9,_aa,_ab){
with(_a9){
_autoresizingMask=_ab;
}
}),new objj_method(sel_getUid("autoresizingMask"),function(_ac,_ad){
with(_ac){
return _autoresizingMask;
}
}),new objj_method(sel_getUid("enterFullScreenMode"),function(_ae,_af){
with(_ae){
return objj_msgSend(_ae,"enterFullScreenMode:withOptions:",nil,nil);
}
}),new objj_method(sel_getUid("enterFullScreenMode:withOptions:"),function(_b0,_b1,_b2,_b3){
with(_b0){
_fullScreenModeState=_b4(_b0);
var _b5=objj_msgSend(objj_msgSend(CPWindow,"alloc"),"initWithContentRect:styleMask:",objj_msgSend(objj_msgSend(CPPlatformWindow,"primaryPlatformWindow"),"contentBounds"),CPBorderlessWindowMask);
objj_msgSend(_b5,"setLevel:",CPScreenSaverWindowLevel);
objj_msgSend(_b5,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
var _b6=objj_msgSend(_b5,"contentView");
objj_msgSend(_b6,"setBackgroundColor:",objj_msgSend(CPColor,"blackColor"));
objj_msgSend(_b6,"addSubview:",_b0);
objj_msgSend(_b0,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
objj_msgSend(_b0,"setFrame:",CGRectMakeCopy(objj_msgSend(_b6,"bounds")));
objj_msgSend(_b5,"makeKeyAndOrderFront:",_b0);
objj_msgSend(_b5,"makeFirstResponder:",_b0);
_isInFullScreenMode=YES;
return YES;
}
}),new objj_method(sel_getUid("exitFullScreenMode"),function(_b7,_b8){
with(_b7){
objj_msgSend(_b7,"exitFullScreenModeWithOptions:",nil);
}
}),new objj_method(sel_getUid("exitFullScreenModeWithOptions:"),function(_b9,_ba,_bb){
with(_b9){
if(!_isInFullScreenMode){
return;
}
_isInFullScreenMode=NO;
objj_msgSend(_b9,"setFrame:",_fullScreenModeState.frame);
objj_msgSend(_b9,"setAutoresizingMask:",_fullScreenModeState.autoresizingMask);
objj_msgSend(_fullScreenModeState.superview,"_insertSubview:atIndex:",_b9,_fullScreenModeState.index);
objj_msgSend(objj_msgSend(_b9,"window"),"orderOut:",_b9);
}
}),new objj_method(sel_getUid("isInFullScreenMode"),function(_bc,_bd){
with(_bc){
return _isInFullScreenMode;
}
}),new objj_method(sel_getUid("setHidden:"),function(_be,_bf,_c0){
with(_be){
_c0=!!_c0;
if(_isHidden===_c0){
return;
}
_isHidden=_c0;
_DOMElement.style.display=_isHidden?"none":"block";
if(_c0){
var _c1=objj_msgSend(_window,"firstResponder");
if(objj_msgSend(_c1,"isKindOfClass:",objj_msgSend(CPView,"class"))){
do{
if(_be==_c1){
objj_msgSend(_window,"makeFirstResponder:",objj_msgSend(_be,"nextValidKeyView"));
break;
}
}while(_c1=objj_msgSend(_c1,"superview"));
}
}
}
}),new objj_method(sel_getUid("isHidden"),function(_c2,_c3){
with(_c2){
return _isHidden;
}
}),new objj_method(sel_getUid("setAlphaValue:"),function(_c4,_c5,_c6){
with(_c4){
if(_opacity==_c6){
return;
}
_opacity=_c6;
if(CPFeatureIsCompatible(CPOpacityRequiresFilterFeature)){
if(_c6==1){
try{
_DOMElement.style.removeAttribute("filter");
}
catch(anException){
}
}else{
_DOMElement.style.filter="alpha(opacity="+_c6*100+")";
}
}else{
_DOMElement.style.opacity=_c6;
}
}
}),new objj_method(sel_getUid("alphaValue"),function(_c7,_c8){
with(_c7){
return _opacity;
}
}),new objj_method(sel_getUid("isHiddenOrHasHiddenAncestor"),function(_c9,_ca){
with(_c9){
var _cb=_c9;
while(_cb&&!objj_msgSend(_cb,"isHidden")){
_cb=objj_msgSend(_cb,"superview");
}
return _cb!==nil;
}
}),new objj_method(sel_getUid("acceptsFirstMouse:"),function(_cc,_cd,_ce){
with(_cc){
return YES;
}
}),new objj_method(sel_getUid("hitTests"),function(_cf,_d0){
with(_cf){
return _hitTests;
}
}),new objj_method(sel_getUid("setHitTests:"),function(_d1,_d2,_d3){
with(_d1){
_hitTests=!!_d3;
}
}),new objj_method(sel_getUid("hitTest:"),function(_d4,_d5,_d6){
with(_d4){
if(_isHidden||!_hitTests||!CPRectContainsPoint(_frame,_d6)){
return nil;
}
var _d7=nil,i=_subviews.length,_d8={x:_d6.x-(_frame.origin.x),y:_d6.y-(_frame.origin.y)};
if(_inverseBoundsTransform){
_d8={x:_d8.x*_inverseBoundsTransform.a+_d8.y*_inverseBoundsTransform.c+_inverseBoundsTransform.tx,y:_d8.x*_inverseBoundsTransform.b+_d8.y*_inverseBoundsTransform.d+_inverseBoundsTransform.ty};
}
while(i--){
if(_d7=objj_msgSend(_subviews[i],"hitTest:",_d8)){
return _d7;
}
}
return _d4;
}
}),new objj_method(sel_getUid("needsPanelToBecomeKey"),function(_d9,_da){
with(_d9){
return NO;
}
}),new objj_method(sel_getUid("mouseDownCanMoveWindow"),function(_db,_dc){
with(_db){
return !objj_msgSend(_db,"isOpaque");
}
}),new objj_method(sel_getUid("mouseDown:"),function(_dd,_de,_df){
with(_dd){
if(objj_msgSend(_dd,"mouseDownCanMoveWindow")){
objj_msgSendSuper({receiver:_dd,super_class:objj_getClass("CPView").super_class},"mouseDown:",_df);
}
}
}),new objj_method(sel_getUid("setBackgroundColor:"),function(_e0,_e1,_e2){
with(_e0){
if(_backgroundColor==_e2){
return;
}
_backgroundColor=_e2;
var _e3=objj_msgSend(_backgroundColor,"patternImage"),_e4=0;
if(objj_msgSend(_e3,"isThreePartImage")){
_backgroundType=objj_msgSend(_e3,"isVertical")?_5:_6;
_e4=3-_DOMImageParts.length;
}else{
if(objj_msgSend(_e3,"isNinePartImage")){
_backgroundType=_7;
_e4=9-_DOMImageParts.length;
}else{
_backgroundType=_4;
_e4=0-_DOMImageParts.length;
}
}
if(_e4>0){
while(_e4--){
var _e5=_3.cloneNode(false);
_e5.style.zIndex=-1000;
_DOMImageParts.push(_e5);
_DOMElement.appendChild(_e5);
}
}else{
_e4=-_e4;
while(_e4--){
_DOMElement.removeChild(_DOMImageParts.pop());
}
}
if(_backgroundType==_4){
_DOMElement.style.background=_backgroundColor?objj_msgSend(_backgroundColor,"cssString"):"";
}else{
var _e6=objj_msgSend(_e3,"imageSlices"),_e7=MIN(_DOMImageParts.length,_e6.length),_e8=_frame.size;
while(_e7--){
var _e9=_e6[_e7],_ea=_DOMImageSizes[_e7]=_e9?objj_msgSend(_e9,"size"):{width:0,height:0};
_DOMImageParts[_e7].style.width=MAX(0,ROUND(_ea.width))+"px";
_DOMImageParts[_e7].style.height=MAX(0,ROUND(_ea.height))+"px";
_DOMImageParts[_e7].style.background=_e9?"url(\""+objj_msgSend(_e9,"filename")+"\")":"";
}
if(_backgroundType==_7){
var _eb=_e8.width-_DOMImageSizes[0].width-_DOMImageSizes[2].width,_ec=_e8.height-_DOMImageSizes[0].height-_DOMImageSizes[6].height;
_DOMImageParts[1].style.width=MAX(0,ROUND(_eb))+"px";
_DOMImageParts[1].style.height=MAX(0,ROUND(_DOMImageSizes[0].height))+"px";
_DOMImageParts[3].style.width=MAX(0,ROUND(_DOMImageSizes[3].width))+"px";
_DOMImageParts[3].style.height=MAX(0,ROUND(_ec))+"px";
_DOMImageParts[4].style.width=MAX(0,ROUND(_eb))+"px";
_DOMImageParts[4].style.height=MAX(0,ROUND(_ec))+"px";
_DOMImageParts[5].style.width=MAX(0,ROUND(_DOMImageSizes[5].width))+"px";
_DOMImageParts[5].style.height=MAX(0,ROUND(_ec))+"px";
_DOMImageParts[7].style.width=MAX(0,ROUND(_eb))+"px";
_DOMImageParts[7].style.height=MAX(0,ROUND(_DOMImageSizes[7].height))+"px";
if(NULL){
var _ed={x:CGPointMake(0,0).x*NULL.a+CGPointMake(0,0).y*NULL.c+NULL.tx,y:CGPointMake(0,0).x*NULL.b+CGPointMake(0,0).y*NULL.d+NULL.ty};
}else{
var _ed={x:0,y:0};
}
_DOMImageParts[0].style.left=ROUND(_ed.x)+"px";
_DOMImageParts[0].style.top=ROUND(_ed.y)+"px";
if(NULL){
var _ed={x:CGPointMake(_DOMImageSizes[0].width,0).x*NULL.a+CGPointMake(_DOMImageSizes[0].width,0).y*NULL.c+NULL.tx,y:CGPointMake(_DOMImageSizes[0].width,0).x*NULL.b+CGPointMake(_DOMImageSizes[0].width,0).y*NULL.d+NULL.ty};
}else{
var _ed={x:_DOMImageSizes[0].width,y:0};
}
_DOMImageParts[1].style.left=ROUND(_ed.x)+"px";
_DOMImageParts[1].style.top=ROUND(_ed.y)+"px";
if(NULL){
var _ed={x:CGPointMake(0,0).x*NULL.a+CGPointMake(0,0).y*NULL.c+NULL.tx,y:CGPointMake(0,0).x*NULL.b+CGPointMake(0,0).y*NULL.d+NULL.ty};
}else{
var _ed={x:0,y:0};
}
_DOMImageParts[2].style.right=ROUND(_ed.x)+"px";
_DOMImageParts[2].style.top=ROUND(_ed.y)+"px";
if(NULL){
var _ed={x:CGPointMake(0,_DOMImageSizes[1].height).x*NULL.a+CGPointMake(0,_DOMImageSizes[1].height).y*NULL.c+NULL.tx,y:CGPointMake(0,_DOMImageSizes[1].height).x*NULL.b+CGPointMake(0,_DOMImageSizes[1].height).y*NULL.d+NULL.ty};
}else{
var _ed={x:0,y:_DOMImageSizes[1].height};
}
_DOMImageParts[3].style.left=ROUND(_ed.x)+"px";
_DOMImageParts[3].style.top=ROUND(_ed.y)+"px";
if(NULL){
var _ed={x:CGPointMake(_DOMImageSizes[0].width,_DOMImageSizes[0].height).x*NULL.a+CGPointMake(_DOMImageSizes[0].width,_DOMImageSizes[0].height).y*NULL.c+NULL.tx,y:CGPointMake(_DOMImageSizes[0].width,_DOMImageSizes[0].height).x*NULL.b+CGPointMake(_DOMImageSizes[0].width,_DOMImageSizes[0].height).y*NULL.d+NULL.ty};
}else{
var _ed={x:_DOMImageSizes[0].width,y:_DOMImageSizes[0].height};
}
_DOMImageParts[4].style.left=ROUND(_ed.x)+"px";
_DOMImageParts[4].style.top=ROUND(_ed.y)+"px";
if(NULL){
var _ed={x:CGPointMake(0,_DOMImageSizes[1].height).x*NULL.a+CGPointMake(0,_DOMImageSizes[1].height).y*NULL.c+NULL.tx,y:CGPointMake(0,_DOMImageSizes[1].height).x*NULL.b+CGPointMake(0,_DOMImageSizes[1].height).y*NULL.d+NULL.ty};
}else{
var _ed={x:0,y:_DOMImageSizes[1].height};
}
_DOMImageParts[5].style.right=ROUND(_ed.x)+"px";
_DOMImageParts[5].style.top=ROUND(_ed.y)+"px";
if(NULL){
var _ed={x:CGPointMake(0,0).x*NULL.a+CGPointMake(0,0).y*NULL.c+NULL.tx,y:CGPointMake(0,0).x*NULL.b+CGPointMake(0,0).y*NULL.d+NULL.ty};
}else{
var _ed={x:0,y:0};
}
_DOMImageParts[6].style.left=ROUND(_ed.x)+"px";
_DOMImageParts[6].style.bottom=ROUND(_ed.y)+"px";
if(NULL){
var _ed={x:CGPointMake(_DOMImageSizes[6].width,0).x*NULL.a+CGPointMake(_DOMImageSizes[6].width,0).y*NULL.c+NULL.tx,y:CGPointMake(_DOMImageSizes[6].width,0).x*NULL.b+CGPointMake(_DOMImageSizes[6].width,0).y*NULL.d+NULL.ty};
}else{
var _ed={x:_DOMImageSizes[6].width,y:0};
}
_DOMImageParts[7].style.left=ROUND(_ed.x)+"px";
_DOMImageParts[7].style.bottom=ROUND(_ed.y)+"px";
if(NULL){
var _ed={x:CGPointMake(0,0).x*NULL.a+CGPointMake(0,0).y*NULL.c+NULL.tx,y:CGPointMake(0,0).x*NULL.b+CGPointMake(0,0).y*NULL.d+NULL.ty};
}else{
var _ed={x:0,y:0};
}
_DOMImageParts[8].style.right=ROUND(_ed.x)+"px";
_DOMImageParts[8].style.bottom=ROUND(_ed.y)+"px";
}else{
if(_backgroundType==_5){
_DOMImageParts[1].style.width=MAX(0,ROUND(_e8.width))+"px";
_DOMImageParts[1].style.height=MAX(0,ROUND(_e8.height-_DOMImageSizes[0].height-_DOMImageSizes[2].height))+"px";
if(NULL){
var _ed={x:CGPointMake(0,0).x*NULL.a+CGPointMake(0,0).y*NULL.c+NULL.tx,y:CGPointMake(0,0).x*NULL.b+CGPointMake(0,0).y*NULL.d+NULL.ty};
}else{
var _ed={x:0,y:0};
}
_DOMImageParts[0].style.left=ROUND(_ed.x)+"px";
_DOMImageParts[0].style.top=ROUND(_ed.y)+"px";
if(NULL){
var _ed={x:CGPointMake(0,_DOMImageSizes[0].height).x*NULL.a+CGPointMake(0,_DOMImageSizes[0].height).y*NULL.c+NULL.tx,y:CGPointMake(0,_DOMImageSizes[0].height).x*NULL.b+CGPointMake(0,_DOMImageSizes[0].height).y*NULL.d+NULL.ty};
}else{
var _ed={x:0,y:_DOMImageSizes[0].height};
}
_DOMImageParts[1].style.left=ROUND(_ed.x)+"px";
_DOMImageParts[1].style.top=ROUND(_ed.y)+"px";
if(NULL){
var _ed={x:CGPointMake(0,0).x*NULL.a+CGPointMake(0,0).y*NULL.c+NULL.tx,y:CGPointMake(0,0).x*NULL.b+CGPointMake(0,0).y*NULL.d+NULL.ty};
}else{
var _ed={x:0,y:0};
}
_DOMImageParts[2].style.left=ROUND(_ed.x)+"px";
_DOMImageParts[2].style.bottom=ROUND(_ed.y)+"px";
}else{
if(_backgroundType==_6){
_DOMImageParts[1].style.width=MAX(0,ROUND(_e8.width-_DOMImageSizes[0].width-_DOMImageSizes[2].width))+"px";
_DOMImageParts[1].style.height=MAX(0,ROUND(_e8.height))+"px";
if(NULL){
var _ed={x:CGPointMake(0,0).x*NULL.a+CGPointMake(0,0).y*NULL.c+NULL.tx,y:CGPointMake(0,0).x*NULL.b+CGPointMake(0,0).y*NULL.d+NULL.ty};
}else{
var _ed={x:0,y:0};
}
_DOMImageParts[0].style.left=ROUND(_ed.x)+"px";
_DOMImageParts[0].style.top=ROUND(_ed.y)+"px";
if(NULL){
var _ed={x:CGPointMake(_DOMImageSizes[0].width,0).x*NULL.a+CGPointMake(_DOMImageSizes[0].width,0).y*NULL.c+NULL.tx,y:CGPointMake(_DOMImageSizes[0].width,0).x*NULL.b+CGPointMake(_DOMImageSizes[0].width,0).y*NULL.d+NULL.ty};
}else{
var _ed={x:_DOMImageSizes[0].width,y:0};
}
_DOMImageParts[1].style.left=ROUND(_ed.x)+"px";
_DOMImageParts[1].style.top=ROUND(_ed.y)+"px";
if(NULL){
var _ed={x:CGPointMake(0,0).x*NULL.a+CGPointMake(0,0).y*NULL.c+NULL.tx,y:CGPointMake(0,0).x*NULL.b+CGPointMake(0,0).y*NULL.d+NULL.ty};
}else{
var _ed={x:0,y:0};
}
_DOMImageParts[2].style.right=ROUND(_ed.x)+"px";
_DOMImageParts[2].style.top=ROUND(_ed.y)+"px";
}
}
}
}
}
}),new objj_method(sel_getUid("backgroundColor"),function(_ee,_ef){
with(_ee){
return _backgroundColor;
}
}),new objj_method(sel_getUid("convertPoint:fromView:"),function(_f0,_f1,_f2,_f3){
with(_f0){
return CGPointApplyAffineTransform(_f2,_f4(_f3,_f0));
}
}),new objj_method(sel_getUid("convertPoint:toView:"),function(_f5,_f6,_f7,_f8){
with(_f5){
return CGPointApplyAffineTransform(_f7,_f4(_f5,_f8));
}
}),new objj_method(sel_getUid("convertSize:fromView:"),function(_f9,_fa,_fb,_fc){
with(_f9){
return CGSizeApplyAffineTransform(_fb,_f4(_fc,_f9));
}
}),new objj_method(sel_getUid("convertSize:toView:"),function(_fd,_fe,_ff,_100){
with(_fd){
return CGSizeApplyAffineTransform(_ff,_f4(_fd,_100));
}
}),new objj_method(sel_getUid("convertRect:fromView:"),function(self,_101,_102,_103){
with(self){
return CGRectApplyAffineTransform(_102,_f4(_103,self));
}
}),new objj_method(sel_getUid("convertRect:toView:"),function(self,_104,_105,_106){
with(self){
return CGRectApplyAffineTransform(_105,_f4(self,_106));
}
}),new objj_method(sel_getUid("setPostsFrameChangedNotifications:"),function(self,_107,_108){
with(self){
_108=!!_108;
if(_postsFrameChangedNotifications===_108){
return;
}
_postsFrameChangedNotifications=_108;
if(_postsFrameChangedNotifications){
objj_msgSend(_1,"postNotificationName:object:",CPViewFrameDidChangeNotification,self);
}
}
}),new objj_method(sel_getUid("postsFrameChangedNotifications"),function(self,_109){
with(self){
return _postsFrameChangedNotifications;
}
}),new objj_method(sel_getUid("setPostsBoundsChangedNotifications:"),function(self,_10a,_10b){
with(self){
_10b=!!_10b;
if(_postsBoundsChangedNotifications===_10b){
return;
}
_postsBoundsChangedNotifications=_10b;
if(_postsBoundsChangedNotifications){
objj_msgSend(_1,"postNotificationName:object:",CPViewBoundsDidChangeNotification,self);
}
}
}),new objj_method(sel_getUid("postsBoundsChangedNotifications"),function(self,_10c){
with(self){
return _postsBoundsChangedNotifications;
}
}),new objj_method(sel_getUid("dragImage:at:offset:event:pasteboard:source:slideBack:"),function(self,_10d,_10e,_10f,_110,_111,_112,_113,_114){
with(self){
objj_msgSend(_window,"dragImage:at:offset:event:pasteboard:source:slideBack:",_10e,objj_msgSend(self,"convertPoint:toView:",_10f,nil),_110,_111,_112,_113,_114);
}
}),new objj_method(sel_getUid("dragView:at:offset:event:pasteboard:source:slideBack:"),function(self,_115,_116,_117,_118,_119,_11a,_11b,_11c){
with(self){
objj_msgSend(_window,"dragView:at:offset:event:pasteboard:source:slideBack:",_116,objj_msgSend(self,"convertPoint:toView:",_117,nil),_118,_119,_11a,_11b,_11c);
}
}),new objj_method(sel_getUid("registerForDraggedTypes:"),function(self,_11d,_11e){
with(self){
if(!_11e||!objj_msgSend(_11e,"count")){
return;
}
var _11f=objj_msgSend(self,"window");
objj_msgSend(_11f,"_noteUnregisteredDraggedTypes:",_registeredDraggedTypes);
objj_msgSend(_registeredDraggedTypes,"addObjectsFromArray:",_11e);
objj_msgSend(_11f,"_noteRegisteredDraggedTypes:",_registeredDraggedTypes);
_registeredDraggedTypesArray=nil;
}
}),new objj_method(sel_getUid("registeredDraggedTypes"),function(self,_120){
with(self){
if(!_registeredDraggedTypesArray){
_registeredDraggedTypesArray=objj_msgSend(_registeredDraggedTypes,"allObjects");
}
return _registeredDraggedTypesArray;
}
}),new objj_method(sel_getUid("unregisterDraggedTypes"),function(self,_121){
with(self){
objj_msgSend(objj_msgSend(self,"window"),"_noteUnregisteredDraggedTypes:",_registeredDraggedTypes);
_registeredDraggedTypes=objj_msgSend(CPSet,"set");
_registeredDraggedTypesArray=[];
}
}),new objj_method(sel_getUid("drawRect:"),function(self,_122,_123){
with(self){
}
}),new objj_method(sel_getUid("setNeedsDisplay:"),function(self,_124,_125){
with(self){
if(_125){
objj_msgSend(self,"setNeedsDisplayInRect:",objj_msgSend(self,"bounds"));
}
}
}),new objj_method(sel_getUid("setNeedsDisplayInRect:"),function(self,_126,_127){
with(self){
if(!(_viewClassFlags&_9)){
return;
}
if((_127.size.width<=0||_127.size.height<=0)){
return;
}
if(_dirtyRect&&!(_dirtyRect.size.width<=0||_dirtyRect.size.height<=0)){
_dirtyRect=CGRectUnion(_127,_dirtyRect);
}else{
_dirtyRect={origin:{x:_127.origin.x,y:_127.origin.y},size:{width:_127.size.width,height:_127.size.height}};
}
_CPDisplayServerAddDisplayObject(self);
}
}),new objj_method(sel_getUid("needsDisplay"),function(self,_128){
with(self){
return _dirtyRect&&!(_dirtyRect.size.width<=0||_dirtyRect.size.height<=0);
}
}),new objj_method(sel_getUid("displayIfNeeded"),function(self,_129){
with(self){
if(objj_msgSend(self,"needsDisplay")){
objj_msgSend(self,"displayRect:",_dirtyRect);
}
}
}),new objj_method(sel_getUid("display"),function(self,_12a){
with(self){
objj_msgSend(self,"displayRect:",objj_msgSend(self,"visibleRect"));
}
}),new objj_method(sel_getUid("displayIfNeededInRect:"),function(self,_12b,_12c){
with(self){
if(objj_msgSend(self,"needsDisplay")){
objj_msgSend(self,"displayRect:",_12c);
}
}
}),new objj_method(sel_getUid("displayRect:"),function(self,_12d,_12e){
with(self){
objj_msgSend(self,"viewWillDraw");
objj_msgSend(self,"displayRectIgnoringOpacity:inContext:",_12e,nil);
_dirtyRect=NULL;
}
}),new objj_method(sel_getUid("displayRectIgnoringOpacity:inContext:"),function(self,_12f,_130,_131){
with(self){
objj_msgSend(self,"lockFocus");
CGContextClearRect(objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort"),_130);
objj_msgSend(self,"drawRect:",_130);
objj_msgSend(self,"unlockFocus");
}
}),new objj_method(sel_getUid("viewWillDraw"),function(self,_132){
with(self){
}
}),new objj_method(sel_getUid("lockFocus"),function(self,_133){
with(self){
if(!_graphicsContext){
var _134=CGBitmapGraphicsContextCreate();
_DOMContentsElement=_134.DOMElement;
_DOMContentsElement.style.zIndex=-100;
_DOMContentsElement.style.overflow="hidden";
_DOMContentsElement.style.position="absolute";
_DOMContentsElement.style.visibility="visible";
_DOMContentsElement.width=ROUND((_frame.size.width));
_DOMContentsElement.height=ROUND((_frame.size.height));
_DOMContentsElement.style.top="0px";
_DOMContentsElement.style.left="0px";
_DOMContentsElement.style.width=ROUND((_frame.size.width))+"px";
_DOMContentsElement.style.height=ROUND((_frame.size.height))+"px";
_DOMElement.appendChild(_DOMContentsElement);
_graphicsContext=objj_msgSend(CPGraphicsContext,"graphicsContextWithGraphicsPort:flipped:",_134,YES);
}
objj_msgSend(CPGraphicsContext,"setCurrentContext:",_graphicsContext);
CGContextSaveGState(objj_msgSend(_graphicsContext,"graphicsPort"));
}
}),new objj_method(sel_getUid("unlockFocus"),function(self,_135){
with(self){
CGContextRestoreGState(objj_msgSend(_graphicsContext,"graphicsPort"));
objj_msgSend(CPGraphicsContext,"setCurrentContext:",nil);
}
}),new objj_method(sel_getUid("setNeedsLayout"),function(self,_136){
with(self){
if(!(_viewClassFlags&_a)){
return;
}
_needsLayout=YES;
_CPDisplayServerAddLayoutObject(self);
}
}),new objj_method(sel_getUid("layoutIfNeeded"),function(self,_137){
with(self){
if(_needsLayout){
_needsLayout=NO;
objj_msgSend(self,"layoutSubviews");
}
}
}),new objj_method(sel_getUid("layoutSubviews"),function(self,_138){
with(self){
}
}),new objj_method(sel_getUid("isOpaque"),function(self,_139){
with(self){
return NO;
}
}),new objj_method(sel_getUid("visibleRect"),function(self,_13a){
with(self){
if(!_superview){
return _bounds;
}
return CGRectIntersection(objj_msgSend(self,"convertRect:fromView:",objj_msgSend(_superview,"visibleRect"),_superview),_bounds);
}
}),new objj_method(sel_getUid("_enclosingClipView"),function(self,_13b){
with(self){
var _13c=_superview,_13d=objj_msgSend(CPClipView,"class");
while(_13c&&!objj_msgSend(_13c,"isKindOfClass:",_13d)){
_13c=_13c._superview;
}
return _13c;
}
}),new objj_method(sel_getUid("scrollPoint:"),function(self,_13e,_13f){
with(self){
var _140=objj_msgSend(self,"_enclosingClipView");
if(!_140){
return;
}
objj_msgSend(_140,"scrollToPoint:",objj_msgSend(self,"convertPoint:toView:",_13f,_140));
}
}),new objj_method(sel_getUid("scrollRectToVisible:"),function(self,_141,_142){
with(self){
var _143=objj_msgSend(self,"visibleRect");
_142=CGRectIntersection(_142,_bounds);
if((_142.size.width<=0||_142.size.height<=0)||CGRectContainsRect(_143,_142)){
return NO;
}
var _144=objj_msgSend(self,"_enclosingClipView");
if(!_144){
return NO;
}
var _145={x:_143.origin.x,y:_143.origin.y};
if((_142.origin.x)<=(_143.origin.x)){
_145.x=(_142.origin.x);
}else{
if((_142.origin.x+_142.size.width)>(_143.origin.x+_143.size.width)){
_145.x+=(_142.origin.x+_142.size.width)-(_143.origin.x+_143.size.width);
}
}
if((_142.origin.y)<=(_143.origin.y)){
_145.y=CGRectGetMinY(_142);
}else{
if((_142.origin.y+_142.size.height)>(_143.origin.y+_143.size.height)){
_145.y+=(_142.origin.y+_142.size.height)-(_143.origin.y+_143.size.height);
}
}
objj_msgSend(_144,"scrollToPoint:",CGPointMake(_145.x,_145.y));
return YES;
}
}),new objj_method(sel_getUid("autoscroll:"),function(self,_146,_147){
with(self){
return objj_msgSend(objj_msgSend(self,"superview"),"autoscroll:",_147);
}
}),new objj_method(sel_getUid("adjustScroll:"),function(self,_148,_149){
with(self){
return _149;
}
}),new objj_method(sel_getUid("scrollRect:by:"),function(self,_14a,_14b,_14c){
with(self){
}
}),new objj_method(sel_getUid("enclosingScrollView"),function(self,_14d){
with(self){
var _14e=_superview,_14f=objj_msgSend(CPScrollView,"class");
while(_14e&&!objj_msgSend(_14e,"isKindOfClass:",_14f)){
_14e=_14e._superview;
}
return _14e;
}
}),new objj_method(sel_getUid("scrollClipView:toPoint:"),function(self,_150,_151,_152){
with(self){
objj_msgSend(_151,"scrollToPoint:",_152);
}
}),new objj_method(sel_getUid("reflectScrolledClipView:"),function(self,_153,_154){
with(self){
}
})]);
class_addMethods(_c,[new objj_method(sel_getUid("initialize"),function(self,_155){
with(self){
if(self!==objj_msgSend(CPView,"class")){
return;
}
_3=document.createElement("div");
var _156=_3.style;
_156.overflow="hidden";
_156.position="absolute";
_156.visibility="visible";
_156.zIndex=0;
_1=objj_msgSend(CPNotificationCenter,"defaultCenter");
}
}),new objj_method(sel_getUid("keyPathsForValuesAffectingFrame"),function(self,_157){
with(self){
return objj_msgSend(CPSet,"setWithObjects:","frameOrigin","frameSize");
}
}),new objj_method(sel_getUid("keyPathsForValuesAffectingBounds"),function(self,_158){
with(self){
return objj_msgSend(CPSet,"setWithObjects:","boundsOrigin","boundsSize");
}
})]);
var _b=objj_getClass("CPView");
if(!_b){
throw new SyntaxError("*** Could not find definition for class \"CPView\"");
}
var _c=_b.isa;
class_addMethods(_b,[new objj_method(sel_getUid("performKeyEquivalent:"),function(self,_159,_15a){
with(self){
var _15b=objj_msgSend(_subviews,"count");
while(_15b--){
if(objj_msgSend(_subviews[_15b],"performKeyEquivalent:",_15a)){
return YES;
}
}
return NO;
}
}),new objj_method(sel_getUid("canBecomeKeyView"),function(self,_15c){
with(self){
return objj_msgSend(self,"acceptsFirstResponder")&&!objj_msgSend(self,"isHiddenOrHasHiddenAncestor");
}
}),new objj_method(sel_getUid("nextKeyView"),function(self,_15d){
with(self){
return _nextKeyView;
}
}),new objj_method(sel_getUid("nextValidKeyView"),function(self,_15e){
with(self){
var _15f=objj_msgSend(self,"nextKeyView");
while(_15f&&!objj_msgSend(_15f,"canBecomeKeyView")){
_15f=objj_msgSend(_15f,"nextKeyView");
}
return _15f;
}
}),new objj_method(sel_getUid("previousKeyView"),function(self,_160){
with(self){
return _previousKeyView;
}
}),new objj_method(sel_getUid("previousValidKeyView"),function(self,_161){
with(self){
var _162=objj_msgSend(self,"previousKeyView");
while(_162&&!objj_msgSend(_162,"canBecomeKeyView")){
_162=objj_msgSend(_162,"previousKeyView");
}
return _162;
}
}),new objj_method(sel_getUid("_setPreviousKeyView:"),function(self,_163,_164){
with(self){
_previousKeyView=_164;
}
}),new objj_method(sel_getUid("setNextKeyView:"),function(self,_165,next){
with(self){
_nextKeyView=next;
objj_msgSend(_nextKeyView,"_setPreviousKeyView:",self);
}
})]);
var _b=objj_getClass("CPView");
if(!_b){
throw new SyntaxError("*** Could not find definition for class \"CPView\"");
}
var _c=_b.isa;
class_addMethods(_b,[new objj_method(sel_getUid("setLayer:"),function(self,_166,_167){
with(self){
if(_layer==_167){
return;
}
if(_layer){
_layer._owningView=nil;
_DOMElement.removeChild(_layer._DOMElement);
}
_layer=_167;
if(_layer){
var _168=CGRectMakeCopy(objj_msgSend(self,"bounds"));
objj_msgSend(_layer,"_setOwningView:",self);
_layer._DOMElement.style.zIndex=100;
_DOMElement.appendChild(_layer._DOMElement);
}
}
}),new objj_method(sel_getUid("layer"),function(self,_169){
with(self){
return _layer;
}
}),new objj_method(sel_getUid("setWantsLayer:"),function(self,_16a,_16b){
with(self){
_wantsLayer=!!_16b;
}
}),new objj_method(sel_getUid("wantsLayer"),function(self,_16c){
with(self){
return _wantsLayer;
}
})]);
var _b=objj_getClass("CPView");
if(!_b){
throw new SyntaxError("*** Could not find definition for class \"CPView\"");
}
var _c=_b.isa;
class_addMethods(_b,[new objj_method(sel_getUid("themeState"),function(self,_16d){
with(self){
return _themeState;
}
}),new objj_method(sel_getUid("hasThemeState:"),function(self,_16e,_16f){
with(self){
return !!(_themeState&((typeof _16f==="string")?CPThemeState(_16f):_16f));
}
}),new objj_method(sel_getUid("setThemeState:"),function(self,_170,_171){
with(self){
var _172=(typeof _171==="string")?CPThemeState(_171):_171;
if(_themeState&_172){
return NO;
}
_themeState|=_172;
objj_msgSend(self,"setNeedsLayout");
objj_msgSend(self,"setNeedsDisplay:",YES);
return YES;
}
}),new objj_method(sel_getUid("unsetThemeState:"),function(self,_173,_174){
with(self){
var _175=((typeof _174==="string")?CPThemeState(_174):_174);
if(!(_themeState&_175)){
return NO;
}
_themeState&=~_175;
objj_msgSend(self,"setNeedsLayout");
objj_msgSend(self,"setNeedsDisplay:",YES);
return YES;
}
}),new objj_method(sel_getUid("_loadThemeAttributes"),function(self,_176){
with(self){
var _177=objj_msgSend(self,"class"),_178=objj_msgSend(_177,"_themeAttributes"),_179=_178.length;
if(!_179){
return;
}
var _17a=objj_msgSend(self,"theme"),_17b=objj_msgSend(_177,"themeClass");
_themeAttributes={};
while(_179--){
var _17c=_178[_179--],_17d=objj_msgSend(objj_msgSend(_CPThemeAttribute,"alloc"),"initWithName:defaultValue:",_17c,_178[_179]);
objj_msgSend(_17d,"setParentAttribute:",objj_msgSend(_17a,"_attributeWithName:forClass:",_17c,_17b));
_themeAttributes[_17c]=_17d;
}
}
}),new objj_method(sel_getUid("setTheme:"),function(self,_17e,_17f){
with(self){
if(_theme===_17f){
return;
}
_theme=_17f;
objj_msgSend(self,"viewDidChangeTheme");
}
}),new objj_method(sel_getUid("theme"),function(self,_180){
with(self){
return _theme;
}
}),new objj_method(sel_getUid("viewDidChangeTheme"),function(self,_181){
with(self){
if(!_themeAttributes){
return;
}
var _182=objj_msgSend(self,"theme"),_183=objj_msgSend(objj_msgSend(self,"class"),"themeClass");
for(var _184 in _themeAttributes){
if(_themeAttributes.hasOwnProperty(_184)){
objj_msgSend(_themeAttributes[_184],"setParentAttribute:",objj_msgSend(_182,"_attributeWithName:forClass:",_184,_183));
}
}
objj_msgSend(self,"setNeedsLayout");
objj_msgSend(self,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("_themeAttributeDictionary"),function(self,_185){
with(self){
var _186=objj_msgSend(CPDictionary,"dictionary");
if(_themeAttributes){
var _187=objj_msgSend(self,"theme");
for(var _188 in _themeAttributes){
if(_themeAttributes.hasOwnProperty(_188)){
objj_msgSend(_186,"setObject:forKey:",_themeAttributes[_188],_188);
}
}
}
return _186;
}
}),new objj_method(sel_getUid("setValue:forThemeAttribute:inState:"),function(self,_189,_18a,_18b,_18c){
with(self){
if(!_themeAttributes||!_themeAttributes[_18b]){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,objj_msgSend(self,"className")+" does not contain theme attribute '"+_18b+"'");
}
var _18d=objj_msgSend(self,"currentValueForThemeAttribute:",_18b);
objj_msgSend(_themeAttributes[_18b],"setValue:forState:",_18a,_18c);
if(objj_msgSend(self,"currentValueForThemeAttribute:",_18b)===_18d){
return;
}
objj_msgSend(self,"setNeedsDisplay:",YES);
objj_msgSend(self,"setNeedsLayout");
}
}),new objj_method(sel_getUid("setValue:forThemeAttribute:"),function(self,_18e,_18f,_190){
with(self){
if(!_themeAttributes||!_themeAttributes[_190]){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,objj_msgSend(self,"className")+" does not contain theme attribute '"+_190+"'");
}
var _191=objj_msgSend(self,"currentValueForThemeAttribute:",_190);
objj_msgSend(_themeAttributes[_190],"setValue:",_18f);
if(objj_msgSend(self,"currentValueForThemeAttribute:",_190)===_191){
return;
}
objj_msgSend(self,"setNeedsDisplay:",YES);
objj_msgSend(self,"setNeedsLayout");
}
}),new objj_method(sel_getUid("valueForThemeAttribute:inState:"),function(self,_192,_193,_194){
with(self){
if(!_themeAttributes||!_themeAttributes[_193]){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,objj_msgSend(self,"className")+" does not contain theme attribute '"+_193+"'");
}
return objj_msgSend(_themeAttributes[_193],"valueForState:",_194);
}
}),new objj_method(sel_getUid("valueForThemeAttribute:"),function(self,_195,_196){
with(self){
if(!_themeAttributes||!_themeAttributes[_196]){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,objj_msgSend(self,"className")+" does not contain theme attribute '"+_196+"'");
}
return objj_msgSend(_themeAttributes[_196],"value");
}
}),new objj_method(sel_getUid("currentValueForThemeAttribute:"),function(self,_197,_198){
with(self){
if(!_themeAttributes||!_themeAttributes[_198]){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,objj_msgSend(self,"className")+" does not contain theme attribute '"+_198+"'");
}
return objj_msgSend(_themeAttributes[_198],"valueForState:",_themeState);
}
}),new objj_method(sel_getUid("createEphemeralSubviewNamed:"),function(self,_199,_19a){
with(self){
return nil;
}
}),new objj_method(sel_getUid("rectForEphemeralSubviewNamed:"),function(self,_19b,_19c){
with(self){
return {origin:{x:0,y:0},size:{width:0,height:0}};
}
}),new objj_method(sel_getUid("layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:"),function(self,_19d,_19e,_19f,_1a0){
with(self){
if(!_ephemeralSubviewsForNames){
_ephemeralSubviewsForNames={};
_ephemeralSubviews=objj_msgSend(CPSet,"set");
}
var _1a1=objj_msgSend(self,"rectForEphemeralSubviewNamed:",_19e);
if(_1a1&&!(_1a1.size.width<=0||_1a1.size.height<=0)){
if(!_ephemeralSubviewsForNames[_19e]){
_ephemeralSubviewsForNames[_19e]=objj_msgSend(self,"createEphemeralSubviewNamed:",_19e);
objj_msgSend(_ephemeralSubviews,"addObject:",_ephemeralSubviewsForNames[_19e]);
if(_ephemeralSubviewsForNames[_19e]){
objj_msgSend(self,"addSubview:positioned:relativeTo:",_ephemeralSubviewsForNames[_19e],_19f,_ephemeralSubviewsForNames[_1a0]);
}
}
if(_ephemeralSubviewsForNames[_19e]){
objj_msgSend(_ephemeralSubviewsForNames[_19e],"setFrame:",_1a1);
}
}else{
if(_ephemeralSubviewsForNames[_19e]){
objj_msgSend(_ephemeralSubviewsForNames[_19e],"removeFromSuperview");
objj_msgSend(_ephemeralSubviews,"removeObject:",_ephemeralSubviewsForNames[_19e]);
delete _ephemeralSubviewsForNames[_19e];
}
}
return _ephemeralSubviewsForNames[_19e];
}
})]);
class_addMethods(_c,[new objj_method(sel_getUid("themeClass"),function(self,_1a2){
with(self){
return nil;
}
}),new objj_method(sel_getUid("themeAttributes"),function(self,_1a3){
with(self){
return nil;
}
}),new objj_method(sel_getUid("_themeAttributes"),function(self,_1a4){
with(self){
if(!_2){
_2={};
}
var _1a5=objj_msgSend(self,"class"),_1a6=objj_msgSend(CPView,"class"),_1a7=[],_1a8=objj_msgSend(CPNull,"null");
for(;_1a5&&_1a5!==_1a6;_1a5=objj_msgSend(_1a5,"superclass")){
var _1a9=_2[class_getName(_1a5)];
if(_1a9){
_1a7=_1a7.length?_1a7.concat(_1a9):_1a7;
_2[objj_msgSend(self,"className")]=_1a7;
break;
}
var _1aa=objj_msgSend(_1a5,"themeAttributes");
if(!_1aa){
continue;
}
var _1ab=objj_msgSend(_1aa,"allKeys"),_1ac=_1ab.length;
while(_1ac--){
var _1ad=_1ab[_1ac],_1ae=objj_msgSend(_1aa,"objectForKey:",_1ad);
_1a7.push(_1ae===_1a8?nil:_1ae);
_1a7.push(_1ad);
}
}
return _1a7;
}
})]);
var _1af="CPViewAutoresizingMask",_1b0="CPViewAutoresizesSubviews",_1b1="CPViewBackgroundColor",_1b2="CPViewBoundsKey",_1b3="CPViewFrameKey",_1b4="CPViewHitTestsKey",_1b5="CPViewIsHiddenKey",_1b6="CPViewOpacityKey",_1b7="CPViewSubviewsKey",_1b8="CPViewSuperviewKey",_1b9="CPViewTagKey",_1ba="CPViewThemeStateKey",_1bb="CPViewWindowKey",_1bc="CPViewNextKeyViewKey",_1bd="CPViewPreviousKeyViewKey";
var _b=objj_getClass("CPView");
if(!_b){
throw new SyntaxError("*** Could not find definition for class \"CPView\"");
}
var _c=_b.isa;
class_addMethods(_b,[new objj_method(sel_getUid("initWithCoder:"),function(self,_1be,_1bf){
with(self){
_DOMElement=_3.cloneNode(false);
_frame=objj_msgSend(_1bf,"decodeRectForKey:",_1b3);
_bounds=objj_msgSend(_1bf,"decodeRectForKey:",_1b2);
self=objj_msgSendSuper({receiver:self,super_class:objj_getClass("CPView").super_class},"initWithCoder:",_1bf);
if(self){
_tag=objj_msgSend(_1bf,"containsValueForKey:",_1b9)?objj_msgSend(_1bf,"decodeIntForKey:",_1b9):-1;
_window=objj_msgSend(_1bf,"decodeObjectForKey:",_1bb);
_subviews=objj_msgSend(_1bf,"decodeObjectForKey:",_1b7)||[];
_superview=objj_msgSend(_1bf,"decodeObjectForKey:",_1b8);
_registeredDraggedTypes=objj_msgSend(CPSet,"set");
_registeredDraggedTypesArray=[];
_autoresizingMask=objj_msgSend(_1bf,"decodeIntForKey:",_1af)||CPViewNotSizable;
_autoresizesSubviews=!objj_msgSend(_1bf,"containsValueForKey:",_1b0)||objj_msgSend(_1bf,"decodeBoolForKey:",_1b0);
_hitTests=!objj_msgSend(_1bf,"containsValueForKey:",_1b4)||objj_msgSend(_1bf,"decodeObjectForKey:",_1b4);
_DOMImageParts=[];
_DOMImageSizes=[];
if(NULL){
var _1c0={x:CGPointMake((_frame.origin.x),(_frame.origin.y)).x*NULL.a+CGPointMake((_frame.origin.x),(_frame.origin.y)).y*NULL.c+NULL.tx,y:CGPointMake((_frame.origin.x),(_frame.origin.y)).x*NULL.b+CGPointMake((_frame.origin.x),(_frame.origin.y)).y*NULL.d+NULL.ty};
}else{
var _1c0={x:(_frame.origin.x),y:(_frame.origin.y)};
}
_DOMElement.style.left=ROUND(_1c0.x)+"px";
_DOMElement.style.top=ROUND(_1c0.y)+"px";
_DOMElement.style.width=MAX(0,ROUND((_frame.size.width)))+"px";
_DOMElement.style.height=MAX(0,ROUND((_frame.size.height)))+"px";
var _1c1=0,_1c2=_subviews.length;
for(;_1c1<_1c2;++_1c1){
_DOMElement.appendChild(_subviews[_1c1]._DOMElement);
}
if(objj_msgSend(_1bf,"containsValueForKey:",_1b5)){
objj_msgSend(self,"setHidden:",objj_msgSend(_1bf,"decodeBoolForKey:",_1b5));
}else{
_isHidden=NO;
}
if(objj_msgSend(_1bf,"containsValueForKey:",_1b6)){
objj_msgSend(self,"setAlphaValue:",objj_msgSend(_1bf,"decodeIntForKey:",_1b6));
}else{
_opacity=1;
}
objj_msgSend(self,"setBackgroundColor:",objj_msgSend(_1bf,"decodeObjectForKey:",_1b1));
objj_msgSend(self,"setupViewFlags");
_theme=objj_msgSend(CPTheme,"defaultTheme");
_themeState=CPThemeState(objj_msgSend(_1bf,"decodeIntForKey:",_1ba));
_themeAttributes={};
var _1c3=objj_msgSend(self,"class"),_1c4=objj_msgSend(_1c3,"themeClass"),_1c5=objj_msgSend(_1c3,"_themeAttributes"),_1c2=_1c5.length;
while(_1c2--){
var _1c6=_1c5[_1c2--];
_themeAttributes[_1c6]=CPThemeAttributeDecode(_1bf,_1c6,_1c5[_1c2],_theme,_1c4);
}
objj_msgSend(self,"setNeedsDisplay:",YES);
objj_msgSend(self,"setNeedsLayout");
}
return self;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(self,_1c7,_1c8){
with(self){
objj_msgSendSuper({receiver:self,super_class:objj_getClass("CPView").super_class},"encodeWithCoder:",_1c8);
if(_tag!==-1){
objj_msgSend(_1c8,"encodeInt:forKey:",_tag,_1b9);
}
objj_msgSend(_1c8,"encodeRect:forKey:",_frame,_1b3);
objj_msgSend(_1c8,"encodeRect:forKey:",_bounds,_1b2);
if(_window!==nil){
objj_msgSend(_1c8,"encodeConditionalObject:forKey:",_window,_1bb);
}
var _1c9=objj_msgSend(_subviews,"count"),_1ca=_subviews;
if(_1c9>0&&objj_msgSend(_ephemeralSubviews,"count")>0){
_1ca=objj_msgSend(_1ca,"copy");
while(_1c9--){
if(objj_msgSend(_ephemeralSubviews,"containsObject:",_1ca[_1c9])){
_1ca.splice(_1c9,1);
}
}
}
if(_1ca.length>0){
objj_msgSend(_1c8,"encodeObject:forKey:",_1ca,_1b7);
}
if(_superview!==nil){
objj_msgSend(_1c8,"encodeConditionalObject:forKey:",_superview,_1b8);
}
if(_autoresizingMask!==CPViewNotSizable){
objj_msgSend(_1c8,"encodeInt:forKey:",_autoresizingMask,_1af);
}
if(!_autoresizesSubviews){
objj_msgSend(_1c8,"encodeBool:forKey:",_autoresizesSubviews,_1b0);
}
if(_backgroundColor!==nil){
objj_msgSend(_1c8,"encodeObject:forKey:",_backgroundColor,_1b1);
}
if(_hitTests!==YES){
objj_msgSend(_1c8,"encodeBool:forKey:",_hitTests,_1b4);
}
if(_opacity!==1){
objj_msgSend(_1c8,"encodeFloat:forKey:",_opacity,_1b6);
}
if(_isHidden){
objj_msgSend(_1c8,"encodeBool:forKey:",_isHidden,_1b5);
}
var _1cb=objj_msgSend(self,"nextKeyView");
if(_1cb!==nil){
objj_msgSend(_1c8,"encodeConditionalObject:forKey:",_1cb,_1bc);
}
var _1cc=objj_msgSend(self,"previousKeyView");
if(_1cc!==nil){
objj_msgSend(_1c8,"encodeConditionalObject:forKey:",_1cc,_1bd);
}
objj_msgSend(_1c8,"encodeInt:forKey:",CPThemeStateName(_themeState),_1ba);
for(var _1cd in _themeAttributes){
if(_themeAttributes.hasOwnProperty(_1cd)){
CPThemeAttributeEncode(_1c8,_themeAttributes[_1cd]);
}
}
}
})]);
var _b4=function(_1ce){
var _1cf=_1ce._superview;
return {autoresizingMask:_1ce._autoresizingMask,frame:CGRectMakeCopy(_1ce._frame),index:(_1cf?objj_msgSend(_1cf._subviews,"indexOfObjectIdenticalTo:",_1ce):0),superview:_1cf};
};
var _f4=function(_1d0,_1d1){
var _1d2=CGAffineTransformMakeIdentity(),_1d3=YES,_1d4=nil,_1d5=nil;
if(_1d0){
var view=_1d0;
while(view&&view!=_1d1){
var _1d6=view._frame;
_1d2.tx+=(_1d6.origin.x);
_1d2.ty+=(_1d6.origin.y);
if(view._boundsTransform){
var tx=_1d2.tx*view._boundsTransform.a+_1d2.ty*view._boundsTransform.c+view._boundsTransform.tx;
_1d2.ty=_1d2.tx*view._boundsTransform.b+_1d2.ty*view._boundsTransform.d+view._boundsTransform.ty;
_1d2.tx=tx;
var a=_1d2.a*view._boundsTransform.a+_1d2.b*view._boundsTransform.c,b=_1d2.a*view._boundsTransform.b+_1d2.b*view._boundsTransform.d,c=_1d2.c*view._boundsTransform.a+_1d2.d*view._boundsTransform.c;
_1d2.d=_1d2.c*view._boundsTransform.b+_1d2.d*view._boundsTransform.d;
_1d2.a=a;
_1d2.b=b;
_1d2.c=c;
}
view=view._superview;
}
if(view===_1d1){
return _1d2;
}else{
if(_1d0&&_1d1){
_1d4=objj_msgSend(_1d0,"window");
_1d5=objj_msgSend(_1d1,"window");
if(_1d4&&_1d5&&_1d4!==_1d5){
_1d3=NO;
var _1d6=objj_msgSend(_1d4,"frame");
_1d2.tx+=(_1d6.origin.x);
_1d2.ty+=(_1d6.origin.y);
}
}
}
}
var view=_1d1;
while(view){
var _1d6=view._frame;
_1d2.tx-=(_1d6.origin.x);
_1d2.ty-=(_1d6.origin.y);
if(view._boundsTransform){
var tx=_1d2.tx*view._inverseBoundsTransform.a+_1d2.ty*view._inverseBoundsTransform.c+view._inverseBoundsTransform.tx;
_1d2.ty=_1d2.tx*view._inverseBoundsTransform.b+_1d2.ty*view._inverseBoundsTransform.d+view._inverseBoundsTransform.ty;
_1d2.tx=tx;
var a=_1d2.a*view._inverseBoundsTransform.a+_1d2.b*view._inverseBoundsTransform.c,b=_1d2.a*view._inverseBoundsTransform.b+_1d2.b*view._inverseBoundsTransform.d,c=_1d2.c*view._inverseBoundsTransform.a+_1d2.d*view._inverseBoundsTransform.c;
_1d2.d=_1d2.c*view._inverseBoundsTransform.b+_1d2.d*view._inverseBoundsTransform.d;
_1d2.a=a;
_1d2.b=b;
_1d2.c=c;
}
view=view._superview;
}
if(!_1d3){
var _1d6=objj_msgSend(_1d5,"frame");
_1d2.tx-=(_1d6.origin.x);
_1d2.ty-=(_1d6.origin.y);
}
return _1d2;
};
p;17;CPViewAnimation.jt;4962;@STATIC;1.0;I;20;AppKit/CPAnimation.jt;4918;
objj_executeFile("AppKit/CPAnimation.j",NO);
CPViewAnimationTargetKey="CPViewAnimationTarget";
CPViewAnimationStartFrameKey="CPViewAnimationStartFrame";
CPViewAnimationEndFrameKey="CPViewAnimationEndFrame";
CPViewAnimationEffectKey="CPViewAnimationEffect";
CPViewAnimationFadeInEffect="CPViewAnimationFadeIn";
CPViewAnimationFadeOutEffect="CPViewAnimationFadeOut";
var _1=objj_allocateClassPair(CPAnimation,"CPViewAnimation"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_viewAnimations")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithViewAnimations:"),function(_3,_4,_5){
with(_3){
if(_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPViewAnimation").super_class},"initWithDuration:animationCurve:",0.5,CPAnimationLinear)){
objj_msgSend(_3,"setViewAnimations:",_5);
}
return _3;
}
}),new objj_method(sel_getUid("startAnimation"),function(_6,_7){
with(_6){
var _8=objj_msgSend(_viewAnimations,"count");
while(_8--){
var _9=objj_msgSend(_viewAnimations,"objectAtIndex:",_8),_a=objj_msgSend(_6,"_targetView:",_9),_b=objj_msgSend(_6,"_startFrame:",_9);
objj_msgSend(_a,"setFrame:",_b);
var _c=objj_msgSend(_6,"_effect:",_9);
if(_c===CPViewAnimationFadeInEffect){
objj_msgSend(_a,"setAlphaValue:",0);
objj_msgSend(_a,"setHidden:",NO);
}else{
if(_c===CPViewAnimationFadeOutEffect){
objj_msgSend(_a,"setAlphaValue:",1);
}
}
}
objj_msgSendSuper({receiver:_6,super_class:objj_getClass("CPViewAnimation").super_class},"startAnimation");
}
}),new objj_method(sel_getUid("setCurrentProgress:"),function(_d,_e,_f){
with(_d){
objj_msgSendSuper({receiver:_d,super_class:objj_getClass("CPViewAnimation").super_class},"setCurrentProgress:",_f);
var _10=objj_msgSend(_viewAnimations,"count");
while(_10--){
var _11=objj_msgSend(_viewAnimations,"objectAtIndex:",_10),_12=objj_msgSend(_d,"_targetView:",_11);
startFrame=objj_msgSend(_d,"_startFrame:",_11);
endFrame=objj_msgSend(_d,"_endFrame:",_11);
differenceFrame=CPRectMakeZero();
differenceFrame.origin.x=endFrame.origin.x-startFrame.origin.x;
differenceFrame.origin.y=endFrame.origin.y-startFrame.origin.y;
differenceFrame.size.width=endFrame.size.width-startFrame.size.width;
differenceFrame.size.height=endFrame.size.height-startFrame.size.height;
var _13=CPRectMakeZero();
_13.origin.x=startFrame.origin.x+differenceFrame.origin.x*_f;
_13.origin.y=startFrame.origin.y+differenceFrame.origin.y*_f;
_13.size.width=startFrame.size.width+differenceFrame.size.width*_f;
_13.size.height=startFrame.size.height+differenceFrame.size.height*_f;
objj_msgSend(_12,"setFrame:",_13);
var _14=objj_msgSend(_d,"_effect:",_11);
if(_14===CPViewAnimationFadeInEffect){
objj_msgSend(_12,"setAlphaValue:",1*_f);
}else{
if(_14===CPViewAnimationFadeOutEffect){
objj_msgSend(_12,"setAlphaValue:",1+(0-1)*_f);
}
}
if(_f===1){
objj_msgSend(_12,"setHidden:",CPRectIsNull(endFrame)||objj_msgSend(_12,"alphaValue")===0);
}
}
}
}),new objj_method(sel_getUid("stopAnimation"),function(_15,_16){
with(_15){
var _17=objj_msgSend(_viewAnimations,"count");
while(_17--){
var _18=objj_msgSend(_viewAnimations,"objectAtIndex:",_17),_19=objj_msgSend(_15,"_targetView:",_18),_1a=objj_msgSend(_15,"_endFrame:",_18);
objj_msgSend(_19,"setFrame:",_1a);
var _1b=objj_msgSend(_15,"_effect:",_18);
if(_1b===CPViewAnimationFadeInEffect){
objj_msgSend(_19,"setAlphaValue:",1);
}else{
if(_1b===CPViewAnimationFadeOutEffect){
objj_msgSend(_19,"setAlphaValue:",0);
}
}
objj_msgSend(_19,"setHidden:",CPRectIsNull(_1a)||objj_msgSend(_19,"alphaValue")===0);
}
objj_msgSendSuper({receiver:_15,super_class:objj_getClass("CPViewAnimation").super_class},"stopAnimation");
}
}),new objj_method(sel_getUid("_targetView:"),function(_1c,_1d,_1e){
with(_1c){
var _1f=objj_msgSend(_1e,"valueForKey:",CPViewAnimationTargetKey);
if(!_1f){
objj_msgSend(CPException,"raise:reason:",CPInternalInconsistencyException,objj_msgSend(CPString,"stringWithFormat:","view animation: %@ does not have a target view",objj_msgSend(_1e,"description")));
}
return _1f;
}
}),new objj_method(sel_getUid("_startFrame:"),function(_20,_21,_22){
with(_20){
var _23=objj_msgSend(_22,"valueForKey:",CPViewAnimationStartFrameKey);
if(!_23){
return objj_msgSend(objj_msgSend(_20,"_targetView:",_22),"frame");
}
return _23;
}
}),new objj_method(sel_getUid("_endFrame:"),function(_24,_25,_26){
with(_24){
var _27=objj_msgSend(_26,"valueForKey:",CPViewAnimationEndFrameKey);
if(!_27){
return objj_msgSend(objj_msgSend(_24,"_targetView:",_26),"frame");
}
return _27;
}
}),new objj_method(sel_getUid("_effect:"),function(_28,_29,_2a){
with(_28){
return objj_msgSend(_2a,"valueForKey:",CPViewAnimationEffectKey);
}
}),new objj_method(sel_getUid("viewAnimations"),function(_2b,_2c){
with(_2b){
return _viewAnimations;
}
}),new objj_method(sel_getUid("setViewAnimations:"),function(_2d,_2e,_2f){
with(_2d){
if(_2f!=_viewAnimations){
objj_msgSend(_2d,"stopAnimation");
_viewAnimations=objj_msgSend(_2f,"copy");
}
}
})]);
p;18;CPViewController.jt;5159;@STATIC;1.0;I;20;AppKit/CPResponder.jt;5115;
objj_executeFile("AppKit/CPResponder.j",NO);
var _1;
var _2=objj_allocateClassPair(CPResponder,"CPViewController"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_view"),new objj_ivar("_representedObject"),new objj_ivar("_title"),new objj_ivar("_cibName"),new objj_ivar("_cibBundle"),new objj_ivar("_cibExternalNameTable")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("representedObject"),function(_4,_5){
with(_4){
return _representedObject;
}
}),new objj_method(sel_getUid("setRepresentedObject:"),function(_6,_7,_8){
with(_6){
_representedObject=_8;
}
}),new objj_method(sel_getUid("title"),function(_9,_a){
with(_9){
return _title;
}
}),new objj_method(sel_getUid("setTitle:"),function(_b,_c,_d){
with(_b){
_title=_d;
}
}),new objj_method(sel_getUid("cibName"),function(_e,_f){
with(_e){
return _cibName;
}
}),new objj_method(sel_getUid("cibBundle"),function(_10,_11){
with(_10){
return _cibBundle;
}
}),new objj_method(sel_getUid("cibExternalNameTable"),function(_12,_13){
with(_12){
return _cibExternalNameTable;
}
}),new objj_method(sel_getUid("init"),function(_14,_15){
with(_14){
return objj_msgSend(_14,"initWithCibName:bundle:",nil,nil);
}
}),new objj_method(sel_getUid("initWithCibName:bundle:"),function(_16,_17,_18,_19){
with(_16){
return objj_msgSend(_16,"initWithCibName:bundle:externalNameTable:",_18,_19,nil);
}
}),new objj_method(sel_getUid("initWithCibName:bundle:owner:"),function(_1a,_1b,_1c,_1d,_1e){
with(_1a){
return objj_msgSend(_1a,"initWithCibName:bundle:externalNameTable:",_1c,_1d,objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",_1e,CPCibOwner));
}
}),new objj_method(sel_getUid("initWithCibName:bundle:externalNameTable:"),function(_1f,_20,_21,_22,_23){
with(_1f){
_1f=objj_msgSendSuper({receiver:_1f,super_class:objj_getClass("CPViewController").super_class},"init");
if(_1f){
_cibName=_21;
_cibBundle=_22||objj_msgSend(CPBundle,"mainBundle");
_cibExternalNameTable=_23||objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",_1f,CPCibOwner);
}
return _1f;
}
}),new objj_method(sel_getUid("loadView"),function(_24,_25){
with(_24){
if(_view){
return;
}
var cib=objj_msgSend(_1,"objectForKey:",_cibName);
if(!cib){
cib=objj_msgSend(objj_msgSend(CPCib,"alloc"),"initWithContentsOfURL:",objj_msgSend(_cibBundle,"pathForResource:",_cibName+".cib"));
objj_msgSend(_1,"setObject:forKey:",cib,_cibName);
}
objj_msgSend(cib,"instantiateCibWithExternalNameTable:",_cibExternalNameTable);
}
}),new objj_method(sel_getUid("view"),function(_26,_27){
with(_26){
if(!_view){
var _28=objj_msgSend(_cibExternalNameTable,"objectForKey:",CPCibOwner);
if(objj_msgSend(_28,"respondsToSelector:",sel_getUid("viewControllerWillLoadCib:"))){
objj_msgSend(_28,"viewControllerWillLoadCib:",_26);
}
objj_msgSend(_26,"loadView");
if(_view===nil&&objj_msgSend(_28,"isKindOfClass:",objj_msgSend(CPDocument,"class"))){
objj_msgSend(_26,"setView:",objj_msgSend(_28,"valueForKey:","view"));
}
if(!_view){
var _29=objj_msgSend(CPString,"stringWithFormat:","View for %@ could not be loaded from Cib or no view specified. Override loadView to load the view manually.",_26);
objj_msgSend(CPException,"raise:reason:",CPInternalInconsistencyException,_29);
}
if(objj_msgSend(_28,"respondsToSelector:",sel_getUid("viewControllerDidLoadCib:"))){
objj_msgSend(_28,"viewControllerDidLoadCib:",_26);
}
objj_msgSend(_26,"viewDidLoad");
}
return _view;
}
}),new objj_method(sel_getUid("viewDidLoad"),function(_2a,_2b){
with(_2a){
}
}),new objj_method(sel_getUid("setView:"),function(_2c,_2d,_2e){
with(_2c){
_view=_2e;
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("initialize"),function(_2f,_30){
with(_2f){
if(_2f===CPViewController){
_1=objj_msgSend(CPDictionary,"dictionary");
}
}
})]);
var _31="CPViewControllerViewKey",_32="CPViewControllerTitleKey",_33="CPViewControllerCibNameKey",_34="CPViewControllerBundleKey";
var _2=objj_getClass("CPViewController");
if(!_2){
throw new SyntaxError("*** Could not find definition for class \"CPViewController\"");
}
var _3=_2.isa;
class_addMethods(_2,[new objj_method(sel_getUid("initWithCoder:"),function(_35,_36,_37){
with(_35){
_35=objj_msgSendSuper({receiver:_35,super_class:objj_getClass("CPViewController").super_class},"initWithCoder:",_37);
if(_35){
_view=objj_msgSend(_37,"decodeObjectForKey:",_31);
_title=objj_msgSend(_37,"decodeObjectForKey:",_32);
_cibName=objj_msgSend(_37,"decodeObjectForKey:",_33);
var _38=objj_msgSend(_37,"decodeObjectForKey:",_34);
_cibBundle=_38?objj_msgSend(CPBundle,"bundleWithPath:",_38):objj_msgSend(CPBundle,"mainBundle");
_cibExternalNameTable=objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",_35,CPCibOwner);
}
return _35;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_39,_3a,_3b){
with(_39){
objj_msgSendSuper({receiver:_39,super_class:objj_getClass("CPViewController").super_class},"encodeWithCoder:",_3b);
objj_msgSend(_3b,"encodeObject:forKey:",_view,_31);
objj_msgSend(_3b,"encodeObject:forKey:",_title,_32);
objj_msgSend(_3b,"encodeObject:forKey:",_cibName,_33);
objj_msgSend(_3b,"encodeObject:forKey:",objj_msgSend(_cibBundle,"bundlePath"),_34);
}
})]);
p;11;CPWebView.jt;13231;@STATIC;1.0;I;15;AppKit/CPView.jt;13191;
objj_executeFile("AppKit/CPView.j",NO);
CPWebViewProgressStartedNotification="CPWebViewProgressStartedNotification";
CPWebViewProgressFinishedNotification="CPWebViewProgressFinishedNotification";
CPWebViewScrollAppKit=1;
CPWebViewScrollNative=2;
var _1=objj_allocateClassPair(CPView,"CPWebView"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_scrollView"),new objj_ivar("_frameView"),new objj_ivar("_iframe"),new objj_ivar("_mainFrameURL"),new objj_ivar("_backwardStack"),new objj_ivar("_forwardStack"),new objj_ivar("_ignoreLoadStart"),new objj_ivar("_ignoreLoadEnd"),new objj_ivar("_downloadDelegate"),new objj_ivar("_frameLoadDelegate"),new objj_ivar("_policyDelegate"),new objj_ivar("_resourceLoadDelegate"),new objj_ivar("_UIDelegate"),new objj_ivar("_wso"),new objj_ivar("_url"),new objj_ivar("_html"),new objj_ivar("_loadCallback"),new objj_ivar("_scrollMode"),new objj_ivar("_scrollSize")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithFrame:frameName:groupName:"),function(_3,_4,_5,_6,_7){
with(_3){
if(_3=objj_msgSend(_3,"initWithFrame:",_5)){
_iframe.name=_6;
}
return _3;
}
}),new objj_method(sel_getUid("initWithFrame:"),function(_8,_9,_a){
with(_8){
if(_8=objj_msgSendSuper({receiver:_8,super_class:objj_getClass("CPWebView").super_class},"initWithFrame:",_a)){
_mainFrameURL=nil;
_backwardStack=[];
_forwardStack=[];
_scrollMode=CPWebViewScrollNative;
objj_msgSend(_8,"_initDOMWithFrame:",_a);
}
return _8;
}
}),new objj_method(sel_getUid("_initDOMWithFrame:"),function(_b,_c,_d){
with(_b){
_ignoreLoadStart=YES;
_ignoreLoadEnd=YES;
_iframe=document.createElement("iframe");
_iframe.name="iframe_"+Math.floor(Math.random()*10000);
_iframe.style.width="100%";
_iframe.style.height="100%";
_iframe.style.borderWidth="0px";
objj_msgSend(_b,"setDrawsBackground:",YES);
_loadCallback=function(){
if(!_ignoreLoadStart){
objj_msgSend(_b,"_startedLoading");
if(_mainFrameURL){
objj_msgSend(_backwardStack,"addObject:",_mainFrameURL);
}
_mainFrameURL=_iframe.src;
_mainFrameURL=_iframe.src;
objj_msgSend(_forwardStack,"removeAllObjects");
}else{
_ignoreLoadStart=NO;
}
if(!_ignoreLoadEnd){
objj_msgSend(_b,"_finishedLoading");
}else{
_ignoreLoadEnd=NO;
}
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
};
if(_iframe.addEventListener){
_iframe.addEventListener("load",_loadCallback,false);
}else{
if(_iframe.attachEvent){
_iframe.attachEvent("onload",_loadCallback);
}
}
_frameView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",objj_msgSend(_b,"bounds"));
objj_msgSend(_frameView,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
_scrollView=objj_msgSend(objj_msgSend(CPScrollView,"alloc"),"initWithFrame:",objj_msgSend(_b,"bounds"));
objj_msgSend(_scrollView,"setAutohidesScrollers:",YES);
objj_msgSend(_scrollView,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
objj_msgSend(_scrollView,"setDocumentView:",_frameView);
_frameView._DOMElement.appendChild(_iframe);
objj_msgSend(_b,"_setScrollMode:",_scrollMode);
objj_msgSend(_b,"addSubview:",_scrollView);
}
}),new objj_method(sel_getUid("setFrameSize:"),function(_e,_f,_10){
with(_e){
objj_msgSendSuper({receiver:_e,super_class:objj_getClass("CPWebView").super_class},"setFrameSize:",_10);
objj_msgSend(_e,"_resizeWebFrame");
}
}),new objj_method(sel_getUid("_resizeWebFrame"),function(_11,_12){
with(_11){
if(_scrollMode===CPWebViewScrollAppKit){
if(_scrollSize){
objj_msgSend(_frameView,"setFrameSize:",_scrollSize);
}else{
objj_msgSend(_frameView,"setFrameSize:",objj_msgSend(_scrollView,"contentSize"));
var win=null;
try{
win=objj_msgSend(_11,"DOMWindow");
}
catch(e){
}
if(win&&win.document){
var _13=win.document.body.scrollWidth,_14=win.document.body.scrollHeight;
_iframe.setAttribute("width",_13);
_iframe.setAttribute("height",_14);
objj_msgSend(_frameView,"setFrameSize:",CGSizeMake(_13,_14));
}else{
CPLog.warn("using default size 800*1600");
objj_msgSend(_frameView,"setFrameSize:",CGSizeMake(800,1600));
}
}
}
}
}),new objj_method(sel_getUid("setScrollMode:"),function(_15,_16,_17){
with(_15){
if(_scrollMode==_17){
return;
}
objj_msgSend(_15,"_setScrollMode:",_17);
}
}),new objj_method(sel_getUid("_setScrollMode:"),function(_18,_19,_1a){
with(_18){
_scrollMode=_1a;
_ignoreLoadStart=YES;
_ignoreLoadEnd=YES;
var _1b=_iframe.parentNode;
_1b.removeChild(_iframe);
if(_scrollMode===CPWebViewScrollAppKit){
objj_msgSend(_scrollView,"setHasHorizontalScroller:",YES);
objj_msgSend(_scrollView,"setHasVerticalScroller:",YES);
_iframe.setAttribute("scrolling","no");
}else{
objj_msgSend(_scrollView,"setHasHorizontalScroller:",NO);
objj_msgSend(_scrollView,"setHasVerticalScroller:",NO);
_iframe.setAttribute("scrolling","auto");
objj_msgSend(_frameView,"setFrameSize:",objj_msgSend(_scrollView,"bounds").size);
}
_1b.appendChild(_iframe);
}
}),new objj_method(sel_getUid("loadHTMLString:"),function(_1c,_1d,_1e){
with(_1c){
objj_msgSend(_1c,"loadHTMLString:baseURL:",_1e,nil);
}
}),new objj_method(sel_getUid("loadHTMLString:baseURL:"),function(_1f,_20,_21,URL){
with(_1f){
objj_msgSend(_1f,"_setScrollMode:",CPWebViewScrollAppKit);
objj_msgSend(_1f,"_startedLoading");
_ignoreLoadStart=YES;
_ignoreLoadEnd=NO;
_url=null;
_html=_21;
objj_msgSend(_1f,"_load");
}
}),new objj_method(sel_getUid("_loadMainFrameURL"),function(_22,_23){
with(_22){
objj_msgSend(_22,"_setScrollMode:",CPWebViewScrollNative);
objj_msgSend(_22,"_startedLoading");
_ignoreLoadStart=YES;
_ignoreLoadEnd=NO;
_url=_mainFrameURL;
_html=null;
objj_msgSend(_22,"_load");
}
}),new objj_method(sel_getUid("_load"),function(_24,_25){
with(_24){
if(_url){
_iframe.src=_url;
}else{
if(_html){
_iframe.src="";
window.setTimeout(function(){
var win=objj_msgSend(_24,"DOMWindow");
win.document.write(_html);
window.setTimeout(_loadCallback,1);
},0);
}
}
}
}),new objj_method(sel_getUid("_startedLoading"),function(_26,_27){
with(_26){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPWebViewProgressStartedNotification,_26);
if(objj_msgSend(_frameLoadDelegate,"respondsToSelector:",sel_getUid("webView:didStartProvisionalLoadForFrame:"))){
objj_msgSend(_frameLoadDelegate,"webView:didStartProvisionalLoadForFrame:",_26,nil);
}
}
}),new objj_method(sel_getUid("_finishedLoading"),function(_28,_29){
with(_28){
objj_msgSend(_28,"_resizeWebFrame");
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPWebViewProgressFinishedNotification,_28);
if(objj_msgSend(_frameLoadDelegate,"respondsToSelector:",sel_getUid("webView:didFinishLoadForFrame:"))){
objj_msgSend(_frameLoadDelegate,"webView:didFinishLoadForFrame:",_28,nil);
}
}
}),new objj_method(sel_getUid("mainFrameURL"),function(_2a,_2b){
with(_2a){
return _mainFrameURL;
}
}),new objj_method(sel_getUid("setMainFrameURL:"),function(_2c,_2d,_2e){
with(_2c){
if(_mainFrameURL){
objj_msgSend(_backwardStack,"addObject:",_mainFrameURL);
}
_mainFrameURL=_2e;
objj_msgSend(_forwardStack,"removeAllObjects");
objj_msgSend(_2c,"_loadMainFrameURL");
}
}),new objj_method(sel_getUid("goBack"),function(_2f,_30){
with(_2f){
if(_backwardStack.length>0){
if(_mainFrameURL){
objj_msgSend(_forwardStack,"addObject:",_mainFrameURL);
}
_mainFrameURL=objj_msgSend(_backwardStack,"lastObject");
objj_msgSend(_backwardStack,"removeLastObject");
objj_msgSend(_2f,"_loadMainFrameURL");
return YES;
}
return NO;
}
}),new objj_method(sel_getUid("goForward"),function(_31,_32){
with(_31){
if(_forwardStack.length>0){
if(_mainFrameURL){
objj_msgSend(_backwardStack,"addObject:",_mainFrameURL);
}
_mainFrameURL=objj_msgSend(_forwardStack,"lastObject");
objj_msgSend(_forwardStack,"removeLastObject");
objj_msgSend(_31,"_loadMainFrameURL");
return YES;
}
return NO;
}
}),new objj_method(sel_getUid("canGoBack"),function(_33,_34){
with(_33){
return (_backwardStack.length>0);
}
}),new objj_method(sel_getUid("canGoForward"),function(_35,_36){
with(_35){
return (_forwardStack.length>0);
}
}),new objj_method(sel_getUid("backForwardList"),function(_37,_38){
with(_37){
return {back:_backwardStack,forward:_forwardStack};
}
}),new objj_method(sel_getUid("close"),function(_39,_3a){
with(_39){
_iframe.parentNode.removeChild(_iframe);
}
}),new objj_method(sel_getUid("DOMWindow"),function(_3b,_3c){
with(_3b){
return (_iframe.contentDocument&&_iframe.contentDocument.defaultView)||_iframe.contentWindow;
}
}),new objj_method(sel_getUid("windowScriptObject"),function(_3d,_3e){
with(_3d){
var win=objj_msgSend(_3d,"DOMWindow");
if(!_wso||win!=objj_msgSend(_wso,"window")){
if(win){
_wso=objj_msgSend(objj_msgSend(CPWebScriptObject,"alloc"),"initWithWindow:",win);
}else{
_wso=nil;
}
}
return _wso;
}
}),new objj_method(sel_getUid("stringByEvaluatingJavaScriptFromString:"),function(_3f,_40,_41){
with(_3f){
var _42=objj_msgSend(_3f,"objectByEvaluatingJavaScriptFromString:",_41);
return _42?String(_42):nil;
}
}),new objj_method(sel_getUid("objectByEvaluatingJavaScriptFromString:"),function(_43,_44,_45){
with(_43){
return objj_msgSend(objj_msgSend(_43,"windowScriptObject"),"evaluateWebScript:",_45);
}
}),new objj_method(sel_getUid("computedStyleForElement:pseudoElement:"),function(_46,_47,_48,_49){
with(_46){
var win=objj_msgSend(objj_msgSend(_46,"windowScriptObject"),"window");
if(win){
return win.document.defaultView.getComputedStyle(_48,_49);
}
return nil;
}
}),new objj_method(sel_getUid("drawsBackground"),function(_4a,_4b){
with(_4a){
return _iframe.style.backgroundColor!="";
}
}),new objj_method(sel_getUid("setDrawsBackground:"),function(_4c,_4d,_4e){
with(_4c){
_iframe.style.backgroundColor=_4e?"white":"";
}
}),new objj_method(sel_getUid("takeStringURLFrom:"),function(_4f,_50,_51){
with(_4f){
objj_msgSend(_4f,"setMainFrameURL:",objj_msgSend(_51,"stringValue"));
}
}),new objj_method(sel_getUid("goBack:"),function(_52,_53,_54){
with(_52){
objj_msgSend(_52,"goBack");
}
}),new objj_method(sel_getUid("goForward:"),function(_55,_56,_57){
with(_55){
objj_msgSend(_55,"goForward");
}
}),new objj_method(sel_getUid("stopLoading:"),function(_58,_59,_5a){
with(_58){
}
}),new objj_method(sel_getUid("reload:"),function(_5b,_5c,_5d){
with(_5b){
objj_msgSend(_5b,"_loadMainFrameURL");
}
}),new objj_method(sel_getUid("print:"),function(_5e,_5f,_60){
with(_5e){
try{
objj_msgSend(_5e,"DOMWindow").print();
}
catch(e){
alert("Please click the webpage and select \"Print\" from the \"File\" menu");
}
}
}),new objj_method(sel_getUid("downloadDelegate"),function(_61,_62){
with(_61){
return _downloadDelegate;
}
}),new objj_method(sel_getUid("setDownloadDelegate:"),function(_63,_64,_65){
with(_63){
_downloadDelegate=_65;
}
}),new objj_method(sel_getUid("frameLoadDelegate"),function(_66,_67){
with(_66){
return _frameLoadDelegate;
}
}),new objj_method(sel_getUid("setFrameLoadDelegate:"),function(_68,_69,_6a){
with(_68){
_frameLoadDelegate=_6a;
}
}),new objj_method(sel_getUid("policyDelegate"),function(_6b,_6c){
with(_6b){
return _policyDelegate;
}
}),new objj_method(sel_getUid("setPolicyDelegate:"),function(_6d,_6e,_6f){
with(_6d){
_policyDelegate=_6f;
}
}),new objj_method(sel_getUid("resourceLoadDelegate"),function(_70,_71){
with(_70){
return _resourceLoadDelegate;
}
}),new objj_method(sel_getUid("setResourceLoadDelegate:"),function(_72,_73,_74){
with(_72){
_resourceLoadDelegate=_74;
}
}),new objj_method(sel_getUid("UIDelegate"),function(_75,_76){
with(_75){
return _UIDelegate;
}
}),new objj_method(sel_getUid("setUIDelegate:"),function(_77,_78,_79){
with(_77){
_UIDelegate=_79;
}
})]);
var _1=objj_allocateClassPair(CPObject,"CPWebScriptObject"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_window")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithWindow:"),function(_7a,_7b,_7c){
with(_7a){
if(_7a=objj_msgSendSuper({receiver:_7a,super_class:objj_getClass("CPWebScriptObject").super_class},"init")){
_window=_7c;
}
return _7a;
}
}),new objj_method(sel_getUid("callWebScriptMethod:withArguments:"),function(_7d,_7e,_7f,_80){
with(_7d){
if(typeof _window[_7f]=="function"){
try{
return _window[_7f].apply(_80);
}
catch(e){
}
}
return undefined;
}
}),new objj_method(sel_getUid("evaluateWebScript:"),function(_81,_82,_83){
with(_81){
try{
return _window.eval(_83);
}
catch(e){
}
return undefined;
}
}),new objj_method(sel_getUid("window"),function(_84,_85){
with(_84){
return _window;
}
})]);
var _1=objj_getClass("CPWebView");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPWebView\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_86,_87,_88){
with(_86){
_86=objj_msgSendSuper({receiver:_86,super_class:objj_getClass("CPWebView").super_class},"initWithCoder:",_88);
if(_86){
_mainFrameURL=nil;
_backwardStack=[];
_forwardStack=[];
_scrollMode=CPWebViewScrollNative;
objj_msgSend(_86,"_initDOMWithFrame:",objj_msgSend(_86,"frame"));
objj_msgSend(_86,"setBackgroundColor:",objj_msgSend(CPColor,"whiteColor"));
}
return _86;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_89,_8a,_8b){
with(_89){
var _8c=_subviews;
_subviews=[];
objj_msgSendSuper({receiver:_89,super_class:objj_getClass("CPWebView").super_class},"encodeWithCoder:",_8b);
_subviews=_8c;
}
})]);
p;20;CPWindowController.jt;9250;@STATIC;1.0;I;21;Foundation/CPObject.jI;21;Foundation/CPString.ji;13;CPResponder.ji;10;CPWindow.ji;12;CPDocument.jt;9129;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("CPResponder.j",YES);
objj_executeFile("CPWindow.j",YES);
objj_executeFile("CPDocument.j",YES);
var _1=objj_allocateClassPair(CPResponder,"CPWindowController"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_window"),new objj_ivar("_documents"),new objj_ivar("_document"),new objj_ivar("_shouldCloseDocument"),new objj_ivar("_supportsMultipleDocuments"),new objj_ivar("_cibOwner"),new objj_ivar("_windowCibName"),new objj_ivar("_windowCibPath"),new objj_ivar("_viewController"),new objj_ivar("_viewControllerContainerView")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("init"),function(_3,_4){
with(_3){
return objj_msgSend(_3,"initWithWindow:",nil);
}
}),new objj_method(sel_getUid("initWithWindow:"),function(_5,_6,_7){
with(_5){
_5=objj_msgSendSuper({receiver:_5,super_class:objj_getClass("CPWindowController").super_class},"init");
if(_5){
objj_msgSend(_5,"setWindow:",_7);
objj_msgSend(_5,"setShouldCloseDocument:",NO);
objj_msgSend(_5,"setNextResponder:",CPApp);
_documents=[];
}
return _5;
}
}),new objj_method(sel_getUid("initWithWindowCibName:"),function(_8,_9,_a){
with(_8){
return objj_msgSend(_8,"initWithWindowCibName:owner:",_a,_8);
}
}),new objj_method(sel_getUid("initWithWindowCibName:owner:"),function(_b,_c,_d,_e){
with(_b){
_b=objj_msgSend(_b,"initWithWindow:",nil);
if(_b){
_cibOwner=_e;
_windowCibName=_d;
}
return _b;
}
}),new objj_method(sel_getUid("initWithWindowCibPath:owner:"),function(_f,_10,_11,_12){
with(_f){
_f=objj_msgSend(_f,"initWithWindow:",nil);
if(_f){
_cibOwner=_12;
_windowCibPath=_11;
}
return _f;
}
}),new objj_method(sel_getUid("loadWindow"),function(_13,_14){
with(_13){
if(_window){
return;
}
objj_msgSend(objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(_cibOwner,"class")),"loadCibFile:externalNameTable:",objj_msgSend(_13,"windowCibPath"),objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",_cibOwner,CPCibOwner));
}
}),new objj_method(sel_getUid("showWindow:"),function(_15,_16,_17){
with(_15){
var _18=objj_msgSend(_15,"window");
if(objj_msgSend(_18,"respondsToSelector:",sel_getUid("becomesKeyOnlyIfNeeded"))&&objj_msgSend(_18,"becomesKeyOnlyIfNeeded")){
objj_msgSend(_18,"orderFront:",_17);
}else{
objj_msgSend(_18,"makeKeyAndOrderFront:",_17);
}
}
}),new objj_method(sel_getUid("isWindowLoaded"),function(_19,_1a){
with(_19){
return _window!==nil;
}
}),new objj_method(sel_getUid("window"),function(_1b,_1c){
with(_1b){
if(!_window){
objj_msgSend(_1b,"windowWillLoad");
objj_msgSend(_document,"windowControllerWillLoadCib:",_1b);
objj_msgSend(_1b,"loadWindow");
if(_window===nil&&objj_msgSend(_cibOwner,"isKindOfClass:",objj_msgSend(CPDocument,"class"))){
objj_msgSend(_1b,"setWindow:",objj_msgSend(_cibOwner,"valueForKey:","window"));
}
if(!_window){
var _1d=objj_msgSend(CPString,"stringWithFormat:","Window for %@ could not be loaded from Cib or no window specified.                                                         Override loadWindow to load the window manually.",_1b);
objj_msgSend(CPException,"raise:reason:",CPInternalInconsistencyException,_1d);
}
objj_msgSend(_1b,"windowDidLoad");
objj_msgSend(_document,"windowControllerDidLoadCib:",_1b);
objj_msgSend(_1b,"synchronizeWindowTitleWithDocumentName");
}
return _window;
}
}),new objj_method(sel_getUid("setWindow:"),function(_1e,_1f,_20){
with(_1e){
objj_msgSend(_window,"setWindowController:",nil);
_window=_20;
objj_msgSend(_window,"setWindowController:",_1e);
objj_msgSend(_window,"setNextResponder:",_1e);
}
}),new objj_method(sel_getUid("windowDidLoad"),function(_21,_22){
with(_21){
}
}),new objj_method(sel_getUid("windowWillLoad"),function(_23,_24){
with(_23){
}
}),new objj_method(sel_getUid("setDocument:"),function(_25,_26,_27){
with(_25){
if(_document===_27){
return;
}
var _28=objj_msgSend(CPNotificationCenter,"defaultCenter");
if(_document){
if(!objj_msgSend(_25,"supportsMultipleDocuments")){
objj_msgSend(_25,"removeDocument:",_document);
}
objj_msgSend(_28,"removeObserver:name:object:",_25,CPDocumentWillSaveNotification,_document);
objj_msgSend(_28,"removeObserver:name:object:",_25,CPDocumentDidSaveNotification,_document);
objj_msgSend(_28,"removeObserver:name:object:",_25,CPDocumentDidFailToSaveNotification,_document);
}
_document=_27;
if(_document){
objj_msgSend(_25,"addDocument:",_document);
objj_msgSend(_28,"addObserver:selector:name:object:",_25,sel_getUid("_documentWillSave:"),CPDocumentWillSaveNotification,_document);
objj_msgSend(_28,"addObserver:selector:name:object:",_25,sel_getUid("_documentDidSave:"),CPDocumentDidSaveNotification,_document);
objj_msgSend(_28,"addObserver:selector:name:object:",_25,sel_getUid("_documentDidFailToSave:"),CPDocumentDidFailToSaveNotification,_document);
objj_msgSend(_25,"setDocumentEdited:",objj_msgSend(_document,"isDocumentEdited"));
}
var _29=objj_msgSend(_document,"viewControllerForWindowController:",_25);
if(_29){
objj_msgSend(_25,"setViewController:",_29);
}
objj_msgSend(_25,"synchronizeWindowTitleWithDocumentName");
}
}),new objj_method(sel_getUid("setSupportsMultipleDocuments:"),function(_2a,_2b,_2c){
with(_2a){
_supportsMultipleDocuments=_2c;
}
}),new objj_method(sel_getUid("supportsMultipleDocuments"),function(_2d,_2e){
with(_2d){
return _supportsMultipleDocuments;
}
}),new objj_method(sel_getUid("addDocument:"),function(_2f,_30,_31){
with(_2f){
if(_31&&!objj_msgSend(_documents,"containsObject:",_31)){
objj_msgSend(_documents,"addObject:",_31);
}
}
}),new objj_method(sel_getUid("removeDocument:"),function(_32,_33,_34){
with(_32){
var _35=objj_msgSend(_documents,"indexOfObjectIdenticalTo:",_34);
if(_35===CPNotFound){
return;
}
objj_msgSend(_documents,"removeObjectAtIndex:",_35);
if(_document===_34&&objj_msgSend(_documents,"count")){
objj_msgSend(_32,"setDocument:",objj_msgSend(_documents,"objectAtIndex:",MIN(_35,objj_msgSend(_documents,"count")-1)));
}
}
}),new objj_method(sel_getUid("removeDocumentAndCloseIfNecessary:"),function(_36,_37,_38){
with(_36){
objj_msgSend(_36,"removeDocument:",_38);
if(!objj_msgSend(_documents,"count")){
objj_msgSend(_36,"close");
}
}
}),new objj_method(sel_getUid("documents"),function(_39,_3a){
with(_39){
return _documents;
}
}),new objj_method(sel_getUid("setViewControllerContainerView:"),function(_3b,_3c,_3d){
with(_3b){
_viewControllerContainerView=_3d;
}
}),new objj_method(sel_getUid("viewControllerContainerView"),function(_3e,_3f){
with(_3e){
return _viewControllerContainerView;
}
}),new objj_method(sel_getUid("setViewController:"),function(_40,_41,_42){
with(_40){
var _43=objj_msgSend(_40,"viewControllerContainerView")||objj_msgSend(objj_msgSend(_40,"window"),"contentView"),_44=objj_msgSend(_viewController,"view"),_45=_44?objj_msgSend(_44,"frame"):objj_msgSend(_43,"bounds");
objj_msgSend(_44,"removeFromSuperview");
_viewController=_42;
_44=objj_msgSend(_viewController,"view");
if(_44){
objj_msgSend(_44,"setFrame:",_45);
objj_msgSend(_43,"addSubview:",_44);
}
}
}),new objj_method(sel_getUid("viewController"),function(_46,_47){
with(_46){
return _viewController;
}
}),new objj_method(sel_getUid("_documentWillSave:"),function(_48,_49,_4a){
with(_48){
objj_msgSend(objj_msgSend(_48,"window"),"setDocumentSaving:",YES);
}
}),new objj_method(sel_getUid("_documentDidSave:"),function(_4b,_4c,_4d){
with(_4b){
objj_msgSend(objj_msgSend(_4b,"window"),"setDocumentSaving:",NO);
}
}),new objj_method(sel_getUid("_documentDidFailToSave:"),function(_4e,_4f,_50){
with(_4e){
objj_msgSend(objj_msgSend(_4e,"window"),"setDocumentSaving:",NO);
}
}),new objj_method(sel_getUid("document"),function(_51,_52){
with(_51){
return _document;
}
}),new objj_method(sel_getUid("setDocumentEdited:"),function(_53,_54,_55){
with(_53){
objj_msgSend(objj_msgSend(_53,"window"),"setDocumentEdited:",_55);
}
}),new objj_method(sel_getUid("close"),function(_56,_57){
with(_56){
objj_msgSend(objj_msgSend(_56,"window"),"close");
}
}),new objj_method(sel_getUid("setShouldCloseDocument:"),function(_58,_59,_5a){
with(_58){
_shouldCloseDocument=_5a;
}
}),new objj_method(sel_getUid("shouldCloseDocument"),function(_5b,_5c){
with(_5b){
return _shouldCloseDocument;
}
}),new objj_method(sel_getUid("owner"),function(_5d,_5e){
with(_5d){
return _cibOwner;
}
}),new objj_method(sel_getUid("windowCibName"),function(_5f,_60){
with(_5f){
if(_windowCibName){
return _windowCibName;
}
return objj_msgSend(objj_msgSend(_windowCibPath,"lastPathComponent"),"stringByDeletingPathExtension");
}
}),new objj_method(sel_getUid("windowCibPath"),function(_61,_62){
with(_61){
if(_windowCibPath){
return _windowCibPath;
}
return objj_msgSend(objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(_cibOwner,"class")),"pathForResource:",_windowCibName+".cib");
}
}),new objj_method(sel_getUid("synchronizeWindowTitleWithDocumentName"),function(_63,_64){
with(_63){
if(!_document||!_window){
return;
}
objj_msgSend(_window,"setTitle:",objj_msgSend(_63,"windowTitleForDocumentDisplayName:",objj_msgSend(_document,"displayName")));
}
}),new objj_method(sel_getUid("windowTitleForDocumentDisplayName:"),function(_65,_66,_67){
with(_65){
return _67;
}
})]);
p;20;_CPCibClassSwapper.jt;1345;@STATIC;1.0;I;21;Foundation/CPObject.jI;21;Foundation/CPString.jt;1274;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("Foundation/CPString.j",NO);
var _1="_CPCibClassSwapperClassNameKey",_2="_CPCibClassSwapperOriginalClassNameKey";
var _3=objj_allocateClassPair(CPObject,"_CPCibClassSwapper"),_4=_3.isa;
objj_registerClassPair(_3);
class_addMethods(_4,[new objj_method(sel_getUid("allocObjectWithCoder:className:"),function(_5,_6,_7,_8){
with(_5){
var _9=objj_msgSend(_7,"classForClassName:",_8);
if(!_9){
_9=objj_lookUpClass(_8);
if(!_9){
return nil;
}
}
return objj_msgSend(_9,"alloc");
}
}),new objj_method(sel_getUid("allocWithCoder:"),function(_a,_b,_c){
with(_a){
if(objj_msgSend(_c,"respondsToSelector:",sel_getUid("usesOriginalClasses"))&&objj_msgSend(_c,"usesOriginalClasses")){
var _d=objj_msgSend(_c,"decodeObjectForKey:",_2),_e=objj_msgSend(_a,"allocObjectWithCoder:className:",_c,_d);
}else{
var _d=objj_msgSend(_c,"decodeObjectForKey:",_1),_e=objj_msgSend(_a,"allocObjectWithCoder:className:",_c,_d);
if(!_e){
CPLog.error("Unable to find class "+_d+" in cib file.");
_e=objj_msgSend(_a,"allocObjectWithCoder:className:",_c,objj_msgSend(_c,"decodeObjectForKey:",_2));
}
}
if(!_e){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Unable to find class "+_d+" in cib file.");
}
return _e;
}
})]);
p;20;_CPCibCustomObject.jt;1717;@STATIC;1.0;I;21;Foundation/CPObject.jt;1672;
objj_executeFile("Foundation/CPObject.j",NO);
var _1="_CPCibCustomObjectClassName";
var _2=objj_allocateClassPair(CPObject,"_CPCibCustomObject"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_className")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("customClassName"),function(_4,_5){
with(_4){
return _className;
}
}),new objj_method(sel_getUid("setCustomClassName:"),function(_6,_7,_8){
with(_6){
_className=_8;
}
}),new objj_method(sel_getUid("description"),function(_9,_a){
with(_9){
return objj_msgSendSuper({receiver:_9,super_class:objj_getClass("_CPCibCustomObject").super_class},"description")+" ("+objj_msgSend(_9,"customClassName")+")";
}
})]);
var _2=objj_getClass("_CPCibCustomObject");
if(!_2){
throw new SyntaxError("*** Could not find definition for class \"_CPCibCustomObject\"");
}
var _3=_2.isa;
class_addMethods(_2,[new objj_method(sel_getUid("initWithCoder:"),function(_b,_c,_d){
with(_b){
_b=objj_msgSendSuper({receiver:_b,super_class:objj_getClass("_CPCibCustomObject").super_class},"init");
if(_b){
_className=objj_msgSend(_d,"decodeObjectForKey:",_1);
}
return _b;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_e,_f,_10){
with(_e){
objj_msgSend(_10,"encodeObject:forKey:",_className,_1);
}
}),new objj_method(sel_getUid("_cibInstantiate"),function(_11,_12){
with(_11){
var _13=CPClassFromString(_className);
if(_13===objj_msgSend(_11,"class")){
_className="CPObject";
return _11;
}
if(!_13){
_13=objj_msgSend(CPObject,"class");
}
if(_13===objj_msgSend(CPApplication,"class")){
return objj_msgSend(CPApplication,"sharedApplication");
}
return objj_msgSend(objj_msgSend(_13,"alloc"),"init");
}
})]);
p;22;_CPCibCustomResource.jt;2919;@STATIC;1.0;I;21;Foundation/CPObject.jI;21;Foundation/CPString.jt;2848;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("Foundation/CPString.j",NO);
var _1="_CPCibCustomResourceClassNameKey",_2="_CPCibCustomResourceResourceNameKey",_3="_CPCibCustomResourcePropertiesKey";
var _4=objj_allocateClassPair(CPObject,"_CPCibCustomResource"),_5=_4.isa;
class_addIvars(_4,[new objj_ivar("_className"),new objj_ivar("_resourceName"),new objj_ivar("_properties")]);
objj_registerClassPair(_4);
class_addMethods(_4,[new objj_method(sel_getUid("initWithClassName:resourceName:properties:"),function(_6,_7,_8,_9,_a){
with(_6){
_6=objj_msgSendSuper({receiver:_6,super_class:objj_getClass("_CPCibCustomResource").super_class},"init");
if(_6){
_className=_8;
_resourceName=_9;
_properties=_a;
}
return _6;
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_b,_c,_d){
with(_b){
_b=objj_msgSendSuper({receiver:_b,super_class:objj_getClass("_CPCibCustomResource").super_class},"init");
if(_b){
_className=objj_msgSend(_d,"decodeObjectForKey:",_1);
_resourceName=objj_msgSend(_d,"decodeObjectForKey:",_2);
_properties=objj_msgSend(_d,"decodeObjectForKey:",_3);
}
return _b;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_e,_f,_10){
with(_e){
objj_msgSend(_10,"encodeObject:forKey:",_className,_1);
objj_msgSend(_10,"encodeObject:forKey:",_resourceName,_2);
objj_msgSend(_10,"encodeObject:forKey:",_properties,_3);
}
}),new objj_method(sel_getUid("awakeAfterUsingCoder:"),function(_11,_12,_13){
with(_11){
if(objj_msgSend(_13,"respondsToSelector:",sel_getUid("bundle"))&&(!objj_msgSend(_13,"respondsToSelector:",sel_getUid("awakenCustomResources"))||objj_msgSend(_13,"awakenCustomResources"))){
if(_className==="CPImage"){
return objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(objj_msgSend(_13,"bundle"),"pathForResource:",_resourceName),_properties.valueForKey("size"));
}
}
return _11;
}
})]);
class_addMethods(_5,[new objj_method(sel_getUid("imageResourceWithName:size:"),function(_14,_15,_16,_17){
with(_14){
return objj_msgSend(objj_msgSend(_14,"alloc"),"initWithClassName:resourceName:properties:","CPImage",_16,objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",_17,"size"));
}
})]);
var _4=objj_getClass("_CPCibCustomResource");
if(!_4){
throw new SyntaxError("*** Could not find definition for class \"_CPCibCustomResource\"");
}
var _5=_4.isa;
class_addMethods(_4,[new objj_method(sel_getUid("filename"),function(_18,_19){
with(_18){
return objj_msgSend(objj_msgSend(CPBundle,"mainBundle"),"pathForResource:",_resourceName);
}
}),new objj_method(sel_getUid("size"),function(_1a,_1b){
with(_1a){
return objj_msgSend(_properties,"objectForKey:","size");
}
}),new objj_method(sel_getUid("isThreePartImage"),function(_1c,_1d){
with(_1c){
return NO;
}
}),new objj_method(sel_getUid("isNinePartImage"),function(_1e,_1f){
with(_1e){
return NO;
}
})]);
p;18;_CPCibCustomView.jt;2402;@STATIC;1.0;i;8;CPView.jt;2371;
objj_executeFile("CPView.j",YES);
var _1=objj_allocateClassPair(CPView,"_CPCibCustomView"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_className")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("customClassName"),function(_3,_4){
with(_3){
return _className;
}
}),new objj_method(sel_getUid("setCustomClassName:"),function(_5,_6,_7){
with(_5){
if(_className===_7){
return;
}
_className=_7;
objj_msgSend(_5,"setNeedsDisplay:",YES);
objj_msgSend(_5,"setNeedsLayout");
}
})]);
var _8="_CPCibCustomViewClassNameKey";
var _1=objj_getClass("_CPCibCustomView");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"_CPCibCustomView\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_9,_a,_b){
with(_9){
_9=objj_msgSendSuper({receiver:_9,super_class:objj_getClass("_CPCibCustomView").super_class},"initWithCoder:",_b);
if(_9){
_className=objj_msgSend(_b,"decodeObjectForKey:",_8);
}
return _9;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_c,_d,_e){
with(_c){
objj_msgSendSuper({receiver:_c,super_class:objj_getClass("_CPCibCustomView").super_class},"encodeWithCoder:",_e);
objj_msgSend(_e,"encodeObject:forKey:",_className,_8);
}
}),new objj_method(sel_getUid("customClassName"),function(_f,_10){
with(_f){
return _className;
}
}),new objj_method(sel_getUid("_cibInstantiate"),function(_11,_12){
with(_11){
var _13=CPClassFromString(_className);
if(!_13){
_13=objj_msgSend(CPView,"class");
}
if(_13===objj_msgSend(_11,"class")){
_className="CPView";
return _11;
}
var _14=objj_msgSend(objj_msgSend(_13,"alloc"),"initWithFrame:",objj_msgSend(_11,"frame"));
if(_14){
objj_msgSend(_14,"setBounds:",objj_msgSend(_11,"bounds"));
var _15=objj_msgSend(_11,"subviews"),_16=0,_17=_15.length;
for(;_16<_17;++_16){
objj_msgSend(_14,"addSubview:",_15[_16]);
}
objj_msgSend(_14,"setAutoresizingMask:",objj_msgSend(_11,"autoresizingMask"));
objj_msgSend(_14,"setAutoresizesSubviews:",objj_msgSend(_11,"autoresizesSubviews"));
objj_msgSend(_14,"setHitTests:",objj_msgSend(_11,"hitTests"));
objj_msgSend(_14,"setHidden:",objj_msgSend(_11,"isHidden"));
objj_msgSend(_14,"setAlphaValue:",objj_msgSend(_11,"alphaValue"));
objj_msgSend(_superview,"replaceSubview:with:",_11,_14);
objj_msgSend(_14,"setBackgroundColor:",objj_msgSend(_11,"backgroundColor"));
}
return _14;
}
})]);
p;23;_CPCibKeyedUnarchiver.jt;1485;@STATIC;1.0;I;30;Foundation/CPKeyedUnarchiver.jt;1431;
objj_executeFile("Foundation/CPKeyedUnarchiver.j",NO);
var _1=objj_allocateClassPair(CPKeyedUnarchiver,"_CPCibKeyedUnarchiver"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_bundle"),new objj_ivar("_awakenCustomResources"),new objj_ivar("_externalObjectsForProxyIdentifiers")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initForReadingWithData:bundle:awakenCustomResources:"),function(_3,_4,_5,_6,_7){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("_CPCibKeyedUnarchiver").super_class},"initForReadingWithData:",_5);
if(_3){
_bundle=_6;
_awakenCustomResources=_7;
objj_msgSend(_3,"setDelegate:",_3);
}
return _3;
}
}),new objj_method(sel_getUid("bundle"),function(_8,_9){
with(_8){
return _bundle;
}
}),new objj_method(sel_getUid("awakenCustomResources"),function(_a,_b){
with(_a){
return _awakenCustomResources;
}
}),new objj_method(sel_getUid("setExternalObjectsForProxyIdentifiers:"),function(_c,_d,_e){
with(_c){
_externalObjectsForProxyIdentifiers=_e;
}
}),new objj_method(sel_getUid("externalObjectForProxyIdentifier:"),function(_f,_10,_11){
with(_f){
return objj_msgSend(_externalObjectsForProxyIdentifiers,"objectForKey:",_11);
}
}),new objj_method(sel_getUid("replaceObjectAtUID:withObject:"),function(_12,_13,_14,_15){
with(_12){
_objects[_14]=_15;
}
}),new objj_method(sel_getUid("objectAtUID:"),function(_16,_17,_18){
with(_16){
return _objects[_18];
}
})]);
p;18;_CPCibObjectData.jt;6216;@STATIC;1.0;I;20;Foundation/CPArray.jI;21;Foundation/CPObject.jI;21;Foundation/CPString.ji;7;CPCib.ji;16;CPCibConnector.ji;23;CPCibControlConnector.ji;22;CPCibOutletConnector.jt;6033;
objj_executeFile("Foundation/CPArray.j",NO);
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("CPCib.j",YES);
objj_executeFile("CPCibConnector.j",YES);
objj_executeFile("CPCibControlConnector.j",YES);
objj_executeFile("CPCibOutletConnector.j",YES);
var _1=objj_allocateClassPair(CPObject,"_CPCibObjectData"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_namesKeys"),new objj_ivar("_namesValues"),new objj_ivar("_accessibilityConnectors"),new objj_ivar("_accessibilityOidsKeys"),new objj_ivar("_accessibilityOidsValues"),new objj_ivar("_classesKeys"),new objj_ivar("_classesValues"),new objj_ivar("_connections"),new objj_ivar("_fontManager"),new objj_ivar("_framework"),new objj_ivar("_nextOid"),new objj_ivar("_objectsKeys"),new objj_ivar("_objectsValues"),new objj_ivar("_oidKeys"),new objj_ivar("_oidValues"),new objj_ivar("_fileOwner"),new objj_ivar("_visibleWindows"),new objj_ivar("_replacementObjects")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("init"),function(_3,_4){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("_CPCibObjectData").super_class},"init");
if(_3){
_namesKeys=[];
_namesValues=[];
_classesKeys=[];
_classesValues=[];
_connections=[];
_framework="";
_nextOid=[];
_objectsKeys=[];
_objectsValues=[];
_oidKeys=[];
_oidValues=[];
_fileOwner=nil;
_visibleWindows=objj_msgSend(CPSet,"set");
}
return _3;
}
}),new objj_method(sel_getUid("displayVisibleWindows"),function(_5,_6){
with(_5){
var _7=nil,_8=objj_msgSend(_visibleWindows,"objectEnumerator");
while(_7=objj_msgSend(_8,"nextObject")){
objj_msgSend(_replacementObjects[objj_msgSend(_7,"UID")],"makeKeyAndOrderFront:",_5);
}
}
})]);
var _9="_CPCibObjectDataNamesKeysKey",_a="_CPCibObjectDataNamesValuesKey",_b="_CPCibObjectDataAccessibilityConnectors",_c="_CPCibObjectDataAccessibilityOidsKeys",_d="_CPCibObjectDataAccessibilityOidsValues",_e="_CPCibObjectDataClassesKeysKey",_f="_CPCibObjectDataClassesValuesKey",_10="_CPCibObjectDataConnectionsKey",_11="_CPCibObjectDataFontManagerKey",_12="_CPCibObjectDataFrameworkKey",_13="_CPCibObjectDataNextOidKey",_14="_CPCibObjectDataObjectsKeysKey",_15="_CPCibObjectDataObjectsValuesKey",_16="_CPCibObjectDataOidKeysKey",_17="_CPCibObjectDataOidValuesKey",_18="_CPCibObjectDataFileOwnerKey",_19="_CPCibObjectDataVisibleWindowsKey";
var _1=objj_getClass("_CPCibObjectData");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"_CPCibObjectData\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_1a,_1b,_1c){
with(_1a){
_1a=objj_msgSendSuper({receiver:_1a,super_class:objj_getClass("_CPCibObjectData").super_class},"init");
if(_1a){
_replacementObjects={};
_namesKeys=objj_msgSend(_1c,"decodeObjectForKey:",_9);
_namesValues=objj_msgSend(_1c,"decodeObjectForKey:",_a);
_classesKeys=objj_msgSend(_1c,"decodeObjectForKey:",_e);
_classesValues=objj_msgSend(_1c,"decodeObjectForKey:",_f);
_connections=objj_msgSend(_1c,"decodeObjectForKey:",_10);
_framework=objj_msgSend(_1c,"decodeObjectForKey:",_12);
_nextOid=objj_msgSend(_1c,"decodeIntForKey:",_13);
_objectsKeys=objj_msgSend(_1c,"decodeObjectForKey:",_14);
_objectsValues=objj_msgSend(_1c,"decodeObjectForKey:",_15);
_oidKeys=objj_msgSend(_1c,"decodeObjectForKey:",_16);
_oidValues=objj_msgSend(_1c,"decodeObjectForKey:",_17);
_fileOwner=objj_msgSend(_1c,"decodeObjectForKey:",_18);
_visibleWindows=objj_msgSend(_1c,"decodeObjectForKey:",_19);
}
return _1a;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_1d,_1e,_1f){
with(_1d){
objj_msgSend(_1f,"encodeObject:forKey:",_namesKeys,_9);
objj_msgSend(_1f,"encodeObject:forKey:",_namesValues,_a);
objj_msgSend(_1f,"encodeObject:forKey:",_classesKeys,_e);
objj_msgSend(_1f,"encodeObject:forKey:",_classesValues,_f);
objj_msgSend(_1f,"encodeObject:forKey:",_connections,_10);
objj_msgSend(_1f,"encodeObject:forKey:",_framework,_12);
objj_msgSend(_1f,"encodeInt:forKey:",_nextOid,_13);
objj_msgSend(_1f,"encodeObject:forKey:",_objectsKeys,_14);
objj_msgSend(_1f,"encodeObject:forKey:",_objectsValues,_15);
objj_msgSend(_1f,"encodeObject:forKey:",_oidKeys,_16);
objj_msgSend(_1f,"encodeObject:forKey:",_oidValues,_17);
objj_msgSend(_1f,"encodeObject:forKey:",_fileOwner,_18);
objj_msgSend(_1f,"encodeObject:forKey:",_visibleWindows,_19);
}
}),new objj_method(sel_getUid("instantiateWithOwner:topLevelObjects:"),function(_20,_21,_22,_23){
with(_20){
var _24=objj_msgSend(_objectsKeys,"count");
while(_24--){
var _25=_objectsKeys[_24],_26=_objectsValues[_24],_27=_25;
if(objj_msgSend(_25,"respondsToSelector:",sel_getUid("_cibInstantiate"))){
var _27=objj_msgSend(_25,"_cibInstantiate");
if(_27!==_25){
_replacementObjects[objj_msgSend(_25,"UID")]=_27;
if(objj_msgSend(_27,"isKindOfClass:",objj_msgSend(CPView,"class"))){
var _28=objj_msgSend(_27,"superview");
if(objj_msgSend(_28,"isKindOfClass:",objj_msgSend(CPClipView,"class"))){
var _29=objj_msgSend(_28,"superview");
if(objj_msgSend(_29,"isKindOfClass:",objj_msgSend(CPScrollView,"class"))){
objj_msgSend(_29,"setDocumentView:",_27);
}
}
}
}
}
if(_23&&_26===_fileOwner&&_25!==_fileOwner){
_23.push(_27);
}
}
}
}),new objj_method(sel_getUid("establishConnectionsWithOwner:topLevelObjects:"),function(_2a,_2b,_2c,_2d){
with(_2a){
_replacementObjects[objj_msgSend(_fileOwner,"UID")]=_2c;
var _2e=0,_2f=_connections.length;
for(;_2e<_2f;++_2e){
var _30=_connections[_2e];
objj_msgSend(_30,"replaceObjects:",_replacementObjects);
objj_msgSend(_30,"establishConnection");
}
}
}),new objj_method(sel_getUid("awakeWithOwner:topLevelObjects:"),function(_31,_32,_33,_34){
with(_31){
var _35=objj_msgSend(_objectsKeys,"count");
while(_35--){
var _36=_objectsKeys[_35],_37=_replacementObjects[objj_msgSend(_36,"UID")];
if(_37){
_36=_37;
}
if(_36!==_33&&objj_msgSend(_36,"respondsToSelector:",sel_getUid("awakeFromCib"))){
objj_msgSend(_36,"awakeFromCib");
}
}
if(objj_msgSend(_33,"respondsToSelector:",sel_getUid("awakeFromCib"))){
objj_msgSend(_33,"awakeFromCib");
}
}
})]);
p;19;_CPCibProxyObject.jt;1009;@STATIC;1.0;I;21;Foundation/CPObject.jt;965;
objj_executeFile("Foundation/CPObject.j",NO);
var _1=objj_allocateClassPair(CPObject,"_CPCibProxyObject"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_identifier")]);
objj_registerClassPair(_1);
var _3="CPIdentifier";
var _1=objj_getClass("_CPCibProxyObject");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"_CPCibProxyObject\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_4,_5,_6){
with(_4){
_4=objj_msgSendSuper({receiver:_4,super_class:objj_getClass("_CPCibProxyObject").super_class},"init");
if(_4){
_identifier=objj_msgSend(_6,"decodeObjectForKey:",_3);
}
if(objj_msgSend(_6,"respondsToSelector:",sel_getUid("externalObjectForProxyIdentifier:"))){
return objj_msgSend(_6,"externalObjectForProxyIdentifier:",_identifier);
}
return _4;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_7,_8,_9){
with(_7){
objj_msgSend(_9,"encodeObject:forKey:",_identifier,_3);
}
})]);
p;22;_CPCibWindowTemplate.jt;4518;@STATIC;1.0;I;21;Foundation/CPObject.jt;4473;
objj_executeFile("Foundation/CPObject.j",NO);
var _1="_CPCibWindowTemplateMinSizeKey",_2="_CPCibWindowTemplateMaxSizeKey",_3="_CPCibWindowTemplateViewClassKey",_4="_CPCibWindowTemplateWindowClassKey",_5="_CPCibWindowTemplateWindowRectKey",_6="_CPCibWindowTempatStyleMaskKey",_7="_CPCibWindowTemplateWindowTitleKey",_8="_CPCibWindowTemplateWindowViewKey",_9="_CPCibWindowTemplateWindowAutorecalculatesKeyViewLoop";
_CPCibWindowTemplateWindowIsFullPlatformWindowKey="_CPCibWindowTemplateWindowIsFullPlatformWindowKey";
var _a=objj_allocateClassPair(CPObject,"_CPCibWindowTemplate"),_b=_a.isa;
class_addIvars(_a,[new objj_ivar("_minSize"),new objj_ivar("_maxSize"),new objj_ivar("_viewClass"),new objj_ivar("_windowClass"),new objj_ivar("_windowRect"),new objj_ivar("_windowStyleMask"),new objj_ivar("_windowTitle"),new objj_ivar("_windowView"),new objj_ivar("_windowAutorecalculatesKeyViewLoop"),new objj_ivar("_windowIsFullPlatformWindow")]);
objj_registerClassPair(_a);
class_addMethods(_a,[new objj_method(sel_getUid("init"),function(_c,_d){
with(_c){
_c=objj_msgSendSuper({receiver:_c,super_class:objj_getClass("_CPCibWindowTemplate").super_class},"init");
if(_c){
_windowClass="CPWindow";
_windowRect=CGRectMake(0,0,400,200);
_windowStyleMask=CPTitledWindowMask|CPClosableWindowMask|CPMiniaturizableWindowMask|CPResizableWindowMask;
_windowTitle="Window";
_windowView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMake(0,0,400,200));
_windowIsFullPlatformWindow=NO;
}
return _c;
}
}),new objj_method(sel_getUid("initWithCoder:"),function(_e,_f,_10){
with(_e){
_e=objj_msgSendSuper({receiver:_e,super_class:objj_getClass("_CPCibWindowTemplate").super_class},"init");
if(_e){
if(objj_msgSend(_10,"containsValueForKey:",_1)){
_minSize=objj_msgSend(_10,"decodeSizeForKey:",_1);
}
if(objj_msgSend(_10,"containsValueForKey:",_2)){
_maxSize=objj_msgSend(_10,"decodeSizeForKey:",_2);
}
_viewClass=objj_msgSend(_10,"decodeObjectForKey:",_3);
_windowClass=objj_msgSend(_10,"decodeObjectForKey:",_4);
_windowRect=objj_msgSend(_10,"decodeRectForKey:",_5);
_windowStyleMask=objj_msgSend(_10,"decodeIntForKey:",_6);
_windowTitle=objj_msgSend(_10,"decodeObjectForKey:",_7);
_windowView=objj_msgSend(_10,"decodeObjectForKey:",_8);
_windowAutorecalculatesKeyViewLoop=!!objj_msgSend(_10,"decodeObjectForKey:",_9);
_windowIsFullPlatformWindow=!!objj_msgSend(_10,"decodeObjectForKey:",_CPCibWindowTemplateWindowIsFullPlatformWindowKey);
}
return _e;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_11,_12,_13){
with(_11){
if(_minSize){
objj_msgSend(_13,"encodeSize:forKey:",_minSize,_1);
}
if(_maxSize){
objj_msgSend(_13,"encodeSize:forKey:",_maxSize,_2);
}
objj_msgSend(_13,"encodeObject:forKey:",_viewClass,_3);
objj_msgSend(_13,"encodeObject:forKey:",_windowClass,_4);
objj_msgSend(_13,"encodeRect:forKey:",_windowRect,_5);
objj_msgSend(_13,"encodeInt:forKey:",_windowStyleMask,_6);
objj_msgSend(_13,"encodeObject:forKey:",_windowTitle,_7);
objj_msgSend(_13,"encodeObject:forKey:",_windowView,_8);
if(_windowAutorecalculatesKeyViewLoop){
objj_msgSend(_13,"encodeObject:forKey:",_windowAutorecalculatesKeyViewLoop,_9);
}
if(_windowIsFullPlatformWindow){
objj_msgSend(_13,"encodeObject:forKey:",_windowIsFullPlatformWindow,_CPCibWindowTemplateWindowIsFullPlatformWindowKey);
}
}
}),new objj_method(sel_getUid("customClassName"),function(_14,_15){
with(_14){
return _windowClass;
}
}),new objj_method(sel_getUid("setCustomClassName:"),function(_16,_17,_18){
with(_16){
_windowClass=_18;
}
}),new objj_method(sel_getUid("windowClass"),function(_19,_1a){
with(_19){
return _windowClass;
}
}),new objj_method(sel_getUid("_cibInstantiate"),function(_1b,_1c){
with(_1b){
var _1d=CPClassFromString(objj_msgSend(_1b,"windowClass"));
var _1e=objj_msgSend(objj_msgSend(_1d,"alloc"),"initWithContentRect:styleMask:",_windowRect,_windowStyleMask);
if(_minSize){
objj_msgSend(_1e,"setMinSize:",_minSize);
}
if(_maxSize){
objj_msgSend(_1e,"setMaxSize:",_maxSize);
}
objj_msgSend(_1e,"setTitle:",_windowTitle);
objj_msgSend(_windowView,"setAutoresizesSubviews:",NO);
objj_msgSend(_1e,"setContentView:",_windowView);
objj_msgSend(_windowView,"setAutoresizesSubviews:",YES);
if(objj_msgSend(_viewClass,"isKindOfClass:",objj_msgSend(CPToolbar,"class"))){
objj_msgSend(_1e,"setToolbar:",_viewClass);
}
objj_msgSend(_1e,"setAutorecalculatesKeyViewLoop:",_windowAutorecalculatesKeyViewLoop);
objj_msgSend(_1e,"setFullBridge:",_windowIsFullPlatformWindow);
return _1e;
}
})]);
p;7;CPCib.jt;5447;@STATIC;1.0;I;21;Foundation/CPObject.jI;28;Foundation/CPURLConnection.jI;25;Foundation/CPURLRequest.ji;20;_CPCibClassSwapper.ji;20;_CPCibCustomObject.ji;22;_CPCibCustomResource.ji;18;_CPCibCustomView.ji;23;_CPCibKeyedUnarchiver.ji;18;_CPCibObjectData.ji;19;_CPCibProxyObject.ji;22;_CPCibWindowTemplate.jt;5137;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("Foundation/CPURLConnection.j",NO);
objj_executeFile("Foundation/CPURLRequest.j",NO);
objj_executeFile("_CPCibClassSwapper.j",YES);
objj_executeFile("_CPCibCustomObject.j",YES);
objj_executeFile("_CPCibCustomResource.j",YES);
objj_executeFile("_CPCibCustomView.j",YES);
objj_executeFile("_CPCibKeyedUnarchiver.j",YES);
objj_executeFile("_CPCibObjectData.j",YES);
objj_executeFile("_CPCibProxyObject.j",YES);
objj_executeFile("_CPCibWindowTemplate.j",YES);
CPCibOwner="CPCibOwner",CPCibTopLevelObjects="CPCibTopLevelObjects",CPCibReplacementClasses="CPCibReplacementClasses",CPCibExternalObjects="CPCibExternalObjects";
var _1="CPCibObjectDataKey";
var _2=objj_allocateClassPair(CPObject,"CPCib"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_data"),new objj_ivar("_bundle"),new objj_ivar("_awakenCustomResources"),new objj_ivar("_loadDelegate")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("initWithContentsOfURL:"),function(_4,_5,_6){
with(_4){
_4=objj_msgSendSuper({receiver:_4,super_class:objj_getClass("CPCib").super_class},"init");
if(_4){
_data=objj_msgSend(CPURLConnection,"sendSynchronousRequest:returningResponse:",objj_msgSend(CPURLRequest,"requestWithURL:",_6),nil);
_awakenCustomResources=YES;
}
return _4;
}
}),new objj_method(sel_getUid("initWithContentsOfURL:loadDelegate:"),function(_7,_8,_9,_a){
with(_7){
_7=objj_msgSendSuper({receiver:_7,super_class:objj_getClass("CPCib").super_class},"init");
if(_7){
objj_msgSend(CPURLConnection,"connectionWithRequest:delegate:",objj_msgSend(CPURLRequest,"requestWithURL:",_9),_7);
_awakenCustomResources=YES;
_loadDelegate=_a;
}
return _7;
}
}),new objj_method(sel_getUid("initWithCibNamed:bundle:"),function(_b,_c,_d,_e){
with(_b){
if(!objj_msgSend(_d,"hasSuffix:",".cib")){
_d=objj_msgSend(_d,"stringByAppendingString:",".cib");
}
_b=objj_msgSend(_b,"initWithContentsOfURL:",objj_msgSend(_e||objj_msgSend(CPBundle,"mainBundle"),"pathForResource:",_d));
if(_b){
_bundle=_e;
}
return _b;
}
}),new objj_method(sel_getUid("initWithCibNamed:bundle:loadDelegate:"),function(_f,_10,_11,_12,_13){
with(_f){
if(!objj_msgSend(_11,"hasSuffix:",".cib")){
_11=objj_msgSend(_11,"stringByAppendingString:",".cib");
}
_f=objj_msgSend(_f,"initWithContentsOfURL:loadDelegate:",objj_msgSend(_12||objj_msgSend(CPBundle,"mainBundle"),"pathForResource:",_11),_13);
if(_f){
_bundle=_12;
}
return _f;
}
}),new objj_method(sel_getUid("_setAwakenCustomResources:"),function(_14,_15,_16){
with(_14){
_awakenCustomResources=_16;
}
}),new objj_method(sel_getUid("_awakenCustomResources"),function(_17,_18){
with(_17){
return _awakenCustomResources;
}
}),new objj_method(sel_getUid("instantiateCibWithExternalNameTable:"),function(_19,_1a,_1b){
with(_19){
var _1c=_bundle,_1d=objj_msgSend(_1b,"objectForKey:",CPCibOwner);
if(!_1c&&_1d){
_1c=objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(_1d,"class"));
}
var _1e=objj_msgSend(objj_msgSend(_CPCibKeyedUnarchiver,"alloc"),"initForReadingWithData:bundle:awakenCustomResources:",_data,_1c,_awakenCustomResources),_1f=objj_msgSend(_1b,"objectForKey:",CPCibReplacementClasses);
if(_1f){
var key=nil,_20=objj_msgSend(_1f,"keyEnumerator");
while(key=objj_msgSend(_20,"nextObject")){
objj_msgSend(_1e,"setClass:forClassName:",objj_msgSend(_1f,"objectForKey:",key),key);
}
}
objj_msgSend(_1e,"setExternalObjectsForProxyIdentifiers:",objj_msgSend(_1b,"objectForKey:",CPCibExternalObjects));
var _21=objj_msgSend(_1e,"decodeObjectForKey:",_1);
if(!_21||!objj_msgSend(_21,"isKindOfClass:",objj_msgSend(_CPCibObjectData,"class"))){
return NO;
}
var _22=objj_msgSend(_1b,"objectForKey:",CPCibTopLevelObjects);
objj_msgSend(_21,"instantiateWithOwner:topLevelObjects:",_1d,_22);
objj_msgSend(_21,"establishConnectionsWithOwner:topLevelObjects:",_1d,_22);
objj_msgSend(_21,"awakeWithOwner:topLevelObjects:",_1d,_22);
objj_msgSend(_21,"displayVisibleWindows");
return YES;
}
}),new objj_method(sel_getUid("instantiateCibWithOwner:topLevelObjects:"),function(_23,_24,_25,_26){
with(_23){
return objj_msgSend(_23,"instantiateCibWithExternalNameTable:",objj_msgSend(CPDictionary,"dictionaryWithObjectsAndKeys:",_25,CPCibOwner,_26,CPCibTopLevelObjects));
}
})]);
var _2=objj_getClass("CPCib");
if(!_2){
throw new SyntaxError("*** Could not find definition for class \"CPCib\"");
}
var _3=_2.isa;
class_addMethods(_2,[new objj_method(sel_getUid("connection:didReceiveData:"),function(_27,_28,_29,_2a){
with(_27){
if(!_2a){
return objj_msgSend(_27,"connection:didFailWithError:",_29,nil);
}
_data=objj_msgSend(CPData,"dataWithRawString:",_2a);
}
}),new objj_method(sel_getUid("connection:didFailWithError:"),function(_2b,_2c,_2d,_2e){
with(_2b){
if(objj_msgSend(_loadDelegate,"respondsToSelector:",sel_getUid("cibDidFailToLoad:"))){
objj_msgSend(_loadDelegate,"cibDidFailToLoad:",_2b);
}
_loadDelegate=nil;
}
}),new objj_method(sel_getUid("connectionDidFinishLoading:"),function(_2f,_30,_31){
with(_2f){
if(objj_msgSend(_loadDelegate,"respondsToSelector:",sel_getUid("cibDidFinishLoading:"))){
objj_msgSend(_loadDelegate,"cibDidFinishLoading:",_2f);
}
_loadDelegate=nil;
}
})]);
p;16;CPCibConnector.jt;2363;@STATIC;1.0;I;21;Foundation/CPObject.jI;29;Foundation/CPKeyValueCoding.jt;2284;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("Foundation/CPKeyValueCoding.j",NO);
var _1="_CPCibConnectorSourceKey",_2="_CPCibConnectorDestinationKey",_3="_CPCibConnectorLabelKey";
var _4=objj_allocateClassPair(CPObject,"CPCibConnector"),_5=_4.isa;
class_addIvars(_4,[new objj_ivar("_source"),new objj_ivar("_destination"),new objj_ivar("_label")]);
objj_registerClassPair(_4);
class_addMethods(_4,[new objj_method(sel_getUid("source"),function(_6,_7){
with(_6){
return _source;
}
}),new objj_method(sel_getUid("setSource:"),function(_8,_9,_a){
with(_8){
_source=_a;
}
}),new objj_method(sel_getUid("destination"),function(_b,_c){
with(_b){
return _destination;
}
}),new objj_method(sel_getUid("setDestination:"),function(_d,_e,_f){
with(_d){
_destination=_f;
}
}),new objj_method(sel_getUid("label"),function(_10,_11){
with(_10){
return _label;
}
}),new objj_method(sel_getUid("setLabel:"),function(_12,_13,_14){
with(_12){
_label=_14;
}
}),new objj_method(sel_getUid("replaceObject:withObject:"),function(_15,_16,_17,_18){
with(_15){
if(_source===_17){
_source=_18;
}
if(_destination===_17){
_destination=_18;
}
}
}),new objj_method(sel_getUid("replaceObjects:"),function(_19,_1a,_1b){
with(_19){
var _1c=_1b[objj_msgSend(_source,"UID")];
if(_1c!==undefined){
_source=_1c;
}
_1c=_1b[objj_msgSend(_destination,"UID")];
if(_1c!==undefined){
_destination=_1c;
}
}
})]);
var _4=objj_getClass("CPCibConnector");
if(!_4){
throw new SyntaxError("*** Could not find definition for class \"CPCibConnector\"");
}
var _5=_4.isa;
class_addMethods(_4,[new objj_method(sel_getUid("initWithCoder:"),function(_1d,_1e,_1f){
with(_1d){
_1d=objj_msgSendSuper({receiver:_1d,super_class:objj_getClass("CPCibConnector").super_class},"init");
if(_1d){
_source=objj_msgSend(_1f,"decodeObjectForKey:",_1);
_destination=objj_msgSend(_1f,"decodeObjectForKey:",_2);
_label=objj_msgSend(_1f,"decodeObjectForKey:",_3);
}
return _1d;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_20,_21,_22){
with(_20){
objj_msgSend(_22,"encodeObject:forKey:",_source,_1);
objj_msgSend(_22,"encodeObject:forKey:",_destination,_2);
objj_msgSend(_22,"encodeObject:forKey:",_label,_3);
}
})]);
var _4=objj_allocateClassPair(CPCibConnector,"_CPCibConnector"),_5=_4.isa;
objj_registerClassPair(_4);
p;23;CPCibControlConnector.jt;1534;@STATIC;1.0;i;16;CPCibConnector.jt;1494;
objj_executeFile("CPCibConnector.j",YES);
var _1=objj_allocateClassPair(CPCibConnector,"CPCibControlConnector"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("establishConnection"),function(_3,_4){
with(_3){
var _5=_label,_6=objj_msgSend(_5,"length");
if(_6&&_5.charAt(_6-1)!==":"){
_5+=":";
}
var _7=CPSelectorFromString(_5);
if(!_7){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"-["+objj_msgSend(_3,"className")+" "+_4+"] selector "+_5+" does not exist.");
}
if(_destination&&!objj_msgSend(_destination,"respondsToSelector:",_7)){
CPLog.warn("Could not connect the action "+_7+" to target of class "+objj_msgSend(_destination,"className"));
return;
}
if(objj_msgSend(_source,"respondsToSelector:",sel_getUid("setAction:"))){
objj_msgSend(_source,sel_getUid("setAction:"),_7);
}else{
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"-["+objj_msgSend(_3,"className")+" "+_4+"] "+objj_msgSend(_source,"description")+" does not respond to setAction:");
}
if(objj_msgSend(_source,"respondsToSelector:",sel_getUid("setTarget:"))){
objj_msgSend(_source,sel_getUid("setTarget:"),_destination);
}else{
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"-["+objj_msgSend(_3,"className")+" "+_4+"] "+objj_msgSend(_source,"description")+" does not respond to setTarget:");
}
}
})]);
var _1=objj_allocateClassPair(CPCibControlConnector,"_CPCibControlConnector"),_2=_1.isa;
objj_registerClassPair(_1);
p;14;CPCibLoading.jt;3540;@STATIC;1.0;I;21;Foundation/CPBundle.jI;25;Foundation/CPDictionary.jI;21;Foundation/CPString.jt;3439;
objj_executeFile("Foundation/CPBundle.j",NO);
objj_executeFile("Foundation/CPDictionary.j",NO);
objj_executeFile("Foundation/CPString.j",NO);
var _1="CPCibOwner";
var _2=objj_getClass("CPObject");
if(!_2){
throw new SyntaxError("*** Could not find definition for class \"CPObject\"");
}
var _3=_2.isa;
class_addMethods(_2,[new objj_method(sel_getUid("awakeFromCib"),function(_4,_5){
with(_4){
}
})]);
var _2=objj_getClass("CPBundle");
if(!_2){
throw new SyntaxError("*** Could not find definition for class \"CPBundle\"");
}
var _3=_2.isa;
class_addMethods(_2,[new objj_method(sel_getUid("loadCibFile:externalNameTable:"),function(_6,_7,_8,_9){
with(_6){
objj_msgSend(objj_msgSend(objj_msgSend(CPCib,"alloc"),"initWithContentsOfURL:",_8),"instantiateCibWithExternalNameTable:",_9);
}
}),new objj_method(sel_getUid("loadCibFile:externalNameTable:loadDelegate:"),function(_a,_b,_c,_d,_e){
with(_a){
objj_msgSend(objj_msgSend(CPCib,"alloc"),"initWithCibNamed:bundle:loadDelegate:",_c,_a,objj_msgSend(objj_msgSend(_CPCibLoadDelegate,"alloc"),"initWithLoadDelegate:externalNameTable:",_e,_d));
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("loadCibFile:externalNameTable:"),function(_f,_10,_11,_12){
with(_f){
objj_msgSend(objj_msgSend(objj_msgSend(CPCib,"alloc"),"initWithContentsOfURL:",_11),"instantiateCibWithExternalNameTable:",_12);
}
}),new objj_method(sel_getUid("loadCibNamed:owner:"),function(_13,_14,_15,_16){
with(_13){
if(!objj_msgSend(_15,"hasSuffix:",".cib")){
_15=objj_msgSend(_15,"stringByAppendingString:",".cib");
}
var _17=_16?objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(_16,"class")):objj_msgSend(CPBundle,"mainBundle"),_18=objj_msgSend(_17,"pathForResource:",_15);
objj_msgSend(_13,"loadCibFile:externalNameTable:",_18,objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",_16,_1));
}
}),new objj_method(sel_getUid("loadCibFile:externalNameTable:loadDelegate:"),function(_19,_1a,_1b,_1c,_1d){
with(_19){
objj_msgSend(objj_msgSend(CPCib,"alloc"),"initWithContentsOfURL:loadDelegate:",_1b,objj_msgSend(objj_msgSend(_CPCibLoadDelegate,"alloc"),"initWithLoadDelegate:externalNameTable:",_1d,_1c));
}
}),new objj_method(sel_getUid("loadCibNamed:owner:loadDelegate:"),function(_1e,_1f,_20,_21,_22){
with(_1e){
if(!objj_msgSend(_20,"hasSuffix:",".cib")){
_20=objj_msgSend(_20,"stringByAppendingString:",".cib");
}
var _23=_21?objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(_21,"class")):objj_msgSend(CPBundle,"mainBundle"),_24=objj_msgSend(_23,"pathForResource:",_20);
objj_msgSend(_1e,"loadCibFile:externalNameTable:loadDelegate:",_24,objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",_21,_1),_22);
}
})]);
var _2=objj_allocateClassPair(CPObject,"_CPCibLoadDelegate"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_loadDelegate"),new objj_ivar("_externalNameTable")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("initWithLoadDelegate:externalNameTable:"),function(_25,_26,_27,_28){
with(_25){
_25=objj_msgSend(_25,"init");
if(_25){
_loadDelegate=_27;
_externalNameTable=_28;
}
return _25;
}
}),new objj_method(sel_getUid("cibDidFinishLoading:"),function(_29,_2a,_2b){
with(_29){
objj_msgSend(_2b,"instantiateCibWithExternalNameTable:",_externalNameTable);
objj_msgSend(_loadDelegate,"cibDidFinishLoading:",_2b);
}
}),new objj_method(sel_getUid("cibDidFailToLoad:"),function(_2c,_2d,_2e){
with(_2c){
objj_msgSend(_loadDelegate,"cibDidFailToLoad:",_2e);
}
})]);
p;22;CPCibOutletConnector.jt;703;@STATIC;1.0;i;16;CPCibConnector.jt;664;
objj_executeFile("CPCibConnector.j",YES);
var _1=objj_allocateClassPair(CPCibConnector,"CPCibOutletConnector"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("establishConnection"),function(_3,_4){
with(_3){
try{
objj_msgSend(_source,"setValue:forKey:",_destination,_label);
}
catch(anException){
if(objj_msgSend(anException,"name")===CPUndefinedKeyException){
CPLog.warn("Could not connect the outlet "+_label+" of target of class "+objj_msgSend(_source,"className"));
}else{
throw anException;
}
}
}
})]);
var _1=objj_allocateClassPair(CPCibOutletConnector,"_CPCibOutletConnector"),_2=_1.isa;
objj_registerClassPair(_1);
p;13;CAAnimation.jt;3814;@STATIC;1.0;I;21;Foundation/CPObject.jI;21;Foundation/CPString.ji;23;CAMediaTimingFunction.jt;3715;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("CAMediaTimingFunction.j",YES);
var _1=objj_allocateClassPair(CPObject,"CAAnimation"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_isRemovedOnCompletion"),new objj_ivar("_delegate")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("init"),function(_3,_4){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CAAnimation").super_class},"init");
if(_3){
_isRemovedOnCompletion=YES;
}
return _3;
}
}),new objj_method(sel_getUid("shouldArchiveValueForKey:"),function(_5,_6,_7){
with(_5){
return YES;
}
}),new objj_method(sel_getUid("setRemovedOnCompletion:"),function(_8,_9,_a){
with(_8){
_isRemovedOnCompletion=_a;
}
}),new objj_method(sel_getUid("removedOnCompletion"),function(_b,_c){
with(_b){
return _isRemovedOnCompletion;
}
}),new objj_method(sel_getUid("isRemovedOnCompletion"),function(_d,_e){
with(_d){
return _isRemovedOnCompletion;
}
}),new objj_method(sel_getUid("timingFunction"),function(_f,_10){
with(_f){
return nil;
}
}),new objj_method(sel_getUid("setDelegate:"),function(_11,_12,_13){
with(_11){
_delegate=_13;
}
}),new objj_method(sel_getUid("delegate"),function(_14,_15){
with(_14){
return _delegate;
}
}),new objj_method(sel_getUid("runActionForKey:object:arguments:"),function(_16,_17,_18,_19,_1a){
with(_16){
objj_msgSend(_19,"addAnimation:forKey:",_16,_18);
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("animation"),function(_1b,_1c){
with(_1b){
return objj_msgSend(objj_msgSend(_1b,"alloc"),"init");
}
}),new objj_method(sel_getUid("defaultValueForKey:"),function(_1d,_1e,_1f){
with(_1d){
return nil;
}
})]);
var _1=objj_allocateClassPair(CAAnimation,"CAPropertyAnimation"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_keyPath"),new objj_ivar("_isCumulative"),new objj_ivar("_isAdditive")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("setKeyPath:"),function(_20,_21,_22){
with(_20){
_keyPath=_22;
}
}),new objj_method(sel_getUid("keyPath"),function(_23,_24){
with(_23){
return _keyPath;
}
}),new objj_method(sel_getUid("setCumulative:"),function(_25,_26,_27){
with(_25){
_isCumulative=_27;
}
}),new objj_method(sel_getUid("cumulative"),function(_28,_29){
with(_28){
return _isCumulative;
}
}),new objj_method(sel_getUid("isCumulative"),function(_2a,_2b){
with(_2a){
return _isCumulative;
}
}),new objj_method(sel_getUid("setAdditive:"),function(_2c,_2d,_2e){
with(_2c){
_isAdditive=_2e;
}
}),new objj_method(sel_getUid("additive"),function(_2f,_30){
with(_2f){
return _isAdditive;
}
}),new objj_method(sel_getUid("isAdditive"),function(_31,_32){
with(_31){
return _isAdditive;
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("animationWithKeyPath:"),function(_33,_34,_35){
with(_33){
var _36=objj_msgSend(_33,"animation");
objj_msgSend(_36,"setKeyPath:",_35);
return _36;
}
})]);
var _1=objj_allocateClassPair(CAPropertyAnimation,"CABasicAnimation"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_fromValue"),new objj_ivar("_toValue"),new objj_ivar("_byValue")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("setFromValue:"),function(_37,_38,_39){
with(_37){
_fromValue=_39;
}
}),new objj_method(sel_getUid("fromValue"),function(_3a,_3b){
with(_3a){
return _fromValue;
}
}),new objj_method(sel_getUid("setToValue:"),function(_3c,_3d,_3e){
with(_3c){
_toValue=_3e;
}
}),new objj_method(sel_getUid("toValue"),function(_3f,_40){
with(_3f){
return _toValue;
}
}),new objj_method(sel_getUid("setByValue:"),function(_41,_42,_43){
with(_41){
_byValue=_43;
}
}),new objj_method(sel_getUid("byValue"),function(_44,_45){
with(_44){
return _byValue;
}
})]);
p;16;CABackingStore.jt;737;@STATIC;1.0;i;12;CGGeometry.ji;17;CPCompatibility.jt;680;
objj_executeFile("CGGeometry.j",YES);
objj_executeFile("CPCompatibility.j",YES);
CABackingStoreGetContext=function(_1){
return _1.context;
};
if(CPFeatureIsCompatible(CPHTMLCanvasFeature)){
CABackingStoreCreate=function(){
var _2=document.createElement("canvas");
_2.style.position="absolute";
return {context:_2.getContext("2d"),buffer:_2,_image:_2};
};
CABackingStoreSetSize=function(_3,_4){
var _5=_3.buffer;
_5.width=_4.width;
_5.height=_4.height;
_5.style.width=_4.width+"px";
_5.style.height=_4.height+"px";
};
}else{
CABackingStoreCreate=function(){
var _6=CGBitmapGraphicsContextCreate();
_6.buffer="";
return {context:_6};
};
CABackingStoreSetSize=function(_7,_8){
};
}
p;14;CAFlashLayer.jt;851;@STATIC;1.0;i;9;CALayer.ji;14;CPFlashMovie.jt;801;
objj_executeFile("CALayer.j",YES);
objj_executeFile("CPFlashMovie.j",YES);
var _1=objj_allocateClassPair(CALayer,"CAFlashLayer"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_flashMovie")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("setFlashMovie:"),function(_3,_4,_5){
with(_3){
if(_flashMovie==_5){
return;
}
_flashMovie=_5;
_DOMElement.innerHTML="<object width = \"100%\" height = \"100%\"><param name = \"movie\" value = \""+_5._fileName+"\"></param><param name = \"wmode\" value = \"transparent\"></param><embed src = \""+_5._fileName+"\" type = \"application/x-shockwave-flash\" wmode = \"transparent\" width = \"100%\" height = \"100%\"></embed></object>";
}
}),new objj_method(sel_getUid("flashMovie"),function(_6,_7){
with(_6){
return _flashMovie;
}
})]);
p;9;CALayer.jt;24760;@STATIC;1.0;I;21;Foundation/CPObject.jI;23;AppKit/CABackingStore.jI;18;AppKit/CGContext.jI;19;AppKit/CGGeometry.ji;12;CGGeometry.jt;24622;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("AppKit/CABackingStore.j",NO);
objj_executeFile("AppKit/CGContext.j",NO);
objj_executeFile("AppKit/CGGeometry.j",NO);
objj_executeFile("CGGeometry.j",YES);
CGAffineTransformMake=function(a,b,c,d,tx,ty){
return {a:a,b:b,c:c,d:d,tx:tx,ty:ty};
};
CGAffineTransformMakeIdentity=function(){
return {a:1,b:0,c:0,d:1,tx:0,ty:0};
};
CGAffineTransformMakeCopy=function(_1){
return {a:_1.a,b:_1.b,c:_1.c,d:_1.d,tx:_1.tx,ty:_1.ty};
};
CGAffineTransformMakeScale=function(sx,sy){
return {a:sx,b:0,c:0,d:sy,tx:0,ty:0};
};
CGAffineTransformMakeTranslation=function(tx,ty){
return {a:1,b:0,c:0,d:1,tx:tx,ty:ty};
};
CGAffineTransformTranslate=function(_2,tx,ty){
return {a:_2.a,b:_2.b,c:_2.c,d:_2.d,tx:_2.tx+_2.a*tx+_2.c*ty,ty:_2.ty+_2.b*tx+_2.d*ty};
};
CGAffineTransformScale=function(_3,sx,sy){
return {a:_3.a*sx,b:_3.b*sx,c:_3.c*sy,d:_3.d*sy,tx:_3.tx,ty:_3.ty};
};
CGAffineTransformConcat=function(_4,_5){
return {a:_4.a*_5.a+_4.b*_5.c,b:_4.a*_5.b+_4.b*_5.d,c:_4.c*_5.a+_4.d*_5.c,d:_4.c*_5.b+_4.d*_5.d,tx:_4.tx*_5.a+_4.ty*_5.c+_5.tx,ty:_4.tx*_5.b+_4.ty*_5.d+_5.ty};
};
CGPointApplyAffineTransform=function(_6,_7){
return {x:_6.x*_7.a+_6.y*_7.c+_7.tx,y:_6.x*_7.b+_6.y*_7.d+_7.ty};
};
CGSizeApplyAffineTransform=function(_8,_9){
return {width:_8.width*_9.a+_8.height*_9.c,height:_8.width*_9.b+_8.height*_9.d};
};
CGAffineTransformIsIdentity=function(_a){
return (_a.a==1&&_a.b==0&&_a.c==0&&_a.d==1&&_a.tx==0&&_a.ty==0);
};
CGAffineTransformEqualToTransform=function(_b,_c){
return (_b.a==_c.a&&_b.b==_c.b&&_b.c==_c.c&&_b.d==_c.d&&_b.tx==_c.tx&&_b.ty==_c.ty);
};
CGStringCreateWithCGAffineTransform=function(_d){
return (" [[ "+_d.a+", "+_d.b+", 0 ], [ "+_d.c+", "+_d.d+", 0 ], [ "+_d.tx+", "+_d.ty+", 1]]");
};
CGAffineTransformCreateCopy=function(_e){
return {a:_e.a,b:_e.b,c:_e.c,d:_e.d,tx:_e.tx,ty:_e.ty};
};
CGAffineTransformMakeRotation=function(_f){
var sin=SIN(_f),cos=COS(_f);
return {a:cos,b:sin,c:-sin,d:cos,tx:0,ty:0};
};
CGAffineTransformRotate=function(_10,_11){
var sin=SIN(_11),cos=COS(_11);
return {a:_10.a*cos+_10.c*sin,b:_10.b*cos+_10.d*sin,c:_10.c*cos-_10.a*sin,d:_10.d*cos-_10.b*sin,tx:_10.tx,ty:_10.ty};
};
CGAffineTransformInvert=function(_12){
var _13=1/(_12.a*_12.d-_12.b*_12.c);
return {a:_13*_12.d,b:-_13*_12.b,c:-_13*_12.c,d:_13*_12.a,tx:_13*(_12.c*_12.ty-_12.d*_12.tx),ty:_13*(_12.b*_12.tx-_12.a*_12.ty)};
};
CGRectApplyAffineTransform=function(_14,_15){
var top=(_14.origin.y),_16=(_14.origin.x),_17=(_14.origin.x+_14.size.width),_18=(_14.origin.y+_14.size.height),_19=CGPointApplyAffineTransform({x:_16,y:top},_15),_1a=CGPointApplyAffineTransform({x:_17,y:top},_15),_1b=CGPointApplyAffineTransform({x:_16,y:_18},_15),_1c=CGPointApplyAffineTransform({x:_17,y:_18},_15),_1d=MIN(_19.x,_1a.x,_1b.x,_1c.x),_1e=MAX(_19.x,_1a.x,_1b.x,_1c.x),_1f=MIN(_19.y,_1a.y,_1b.y,_1c.y),_20=MAX(_19.y,_1a.y,_1b.y,_1c.y);
return {origin:{x:_1d,y:_1f},size:{width:(_1e-_1d),height:(_20-_1f)}};
};
CPStringFromCGAffineTransform=function(_21){
return "{"+_21.a+", "+_21.b+", "+_21.c+", "+_21.d+", "+_21.tx+", "+_21.ty+"}";
};
var _22=1,_23=2,_24=4,_25=8,_26=16;
var _27=NO;
var _28=1,_29=2,_2a=4,_2b=8,_2c=16,_2d=_2a|_28|_29;
var _2e=nil;
var _2f=objj_allocateClassPair(CPObject,"CALayer"),_30=_2f.isa;
class_addIvars(_2f,[new objj_ivar("_frame"),new objj_ivar("_bounds"),new objj_ivar("_position"),new objj_ivar("_zPosition"),new objj_ivar("_anchorPoint"),new objj_ivar("_affineTransform"),new objj_ivar("_sublayerTransform"),new objj_ivar("_sublayerTransformForSublayers"),new objj_ivar("_backingStoreFrame"),new objj_ivar("_standardBackingStoreFrame"),new objj_ivar("_hasSublayerTransform"),new objj_ivar("_hasCustomBackingStoreFrame"),new objj_ivar("_opacity"),new objj_ivar("_isHidden"),new objj_ivar("_backgroundColor"),new objj_ivar("_superlayer"),new objj_ivar("_sublayers"),new objj_ivar("_runLoopUpdateMask"),new objj_ivar("_needsDisplayOnBoundsChange"),new objj_ivar("_delegate"),new objj_ivar("_delegateRespondsToDisplayLayerSelector"),new objj_ivar("_delegateRespondsToDrawLayerInContextSelector"),new objj_ivar("_DOMElement"),new objj_ivar("_DOMContentsElement"),new objj_ivar("_contents"),new objj_ivar("_context"),new objj_ivar("_owningView"),new objj_ivar("_transformToLayer"),new objj_ivar("_transformFromLayer")]);
objj_registerClassPair(_2f);
class_addMethods(_2f,[new objj_method(sel_getUid("init"),function(_31,_32){
with(_31){
_31=objj_msgSendSuper({receiver:_31,super_class:objj_getClass("CALayer").super_class},"init");
if(_31){
_frame=CGRectMakeZero();
_backingStoreFrame=CGRectMakeZero();
_standardBackingStoreFrame=CGRectMakeZero();
_bounds=CGRectMakeZero();
_position=CGPointMakeZero();
_zPosition=0;
_anchorPoint=CGPointMake(0.5,0.5);
_affineTransform=CGAffineTransformMakeIdentity();
_sublayerTransform=CGAffineTransformMakeIdentity();
_transformToLayer=CGAffineTransformMakeIdentity();
_transformFromLayer=CGAffineTransformMakeIdentity();
_opacity=1;
_isHidden=NO;
_masksToBounds=NO;
_sublayers=[];
_DOMElement=document.createElement("div");
_DOMElement.style.overflow="visible";
_DOMElement.style.position="absolute";
_DOMElement.style.visibility="visible";
_DOMElement.style.top="0px";
_DOMElement.style.left="0px";
_DOMElement.style.zIndex=0;
_DOMElement.style.width="0px";
_DOMElement.style.height="0px";
}
return _31;
}
}),new objj_method(sel_getUid("setBounds:"),function(_33,_34,_35){
with(_33){
if(CGRectEqualToRect(_bounds,_35)){
return;
}
var _36=_bounds.origin;
_bounds={origin:{x:_35.origin.x,y:_35.origin.y},size:{width:_35.size.width,height:_35.size.height}};
if(_hasSublayerTransform){
_CALayerUpdateSublayerTransformForSublayers(_33);
}
_CALayerRecalculateGeometry(_33,_22);
}
}),new objj_method(sel_getUid("bounds"),function(_37,_38){
with(_37){
return _bounds;
}
}),new objj_method(sel_getUid("setPosition:"),function(_39,_3a,_3b){
with(_39){
if(CGPointEqualToPoint(_position,_3b)){
return;
}
_position={x:_3b.x,y:_3b.y};
_CALayerRecalculateGeometry(_39,_23);
}
}),new objj_method(sel_getUid("position"),function(_3c,_3d){
with(_3c){
return _position;
}
}),new objj_method(sel_getUid("setZPosition:"),function(_3e,_3f,_40){
with(_3e){
if(_zPosition==_40){
return;
}
_zPosition=_40;
objj_msgSend(_3e,"registerRunLoopUpdateWithMask:",_2a);
}
}),new objj_method(sel_getUid("setAnchorPoint:"),function(_41,_42,_43){
with(_41){
_43={x:_43.x,y:_43.y};
_43.x=MIN(1,MAX(0,_43.x));
_43.y=MIN(1,MAX(0,_43.y));
if(CGPointEqualToPoint(_anchorPoint,_43)){
return;
}
_anchorPoint=_43;
if(_hasSublayerTransform){
_CALayerUpdateSublayerTransformForSublayers(_41);
}
if(_owningView){
_position=CGPointMake((_bounds.size.width)*_anchorPoint.x,(_bounds.size.height)*_anchorPoint.y);
}
_CALayerRecalculateGeometry(_41,_24);
}
}),new objj_method(sel_getUid("anchorPoint"),function(_44,_45){
with(_44){
return _anchorPoint;
}
}),new objj_method(sel_getUid("setAffineTransform:"),function(_46,_47,_48){
with(_46){
if(CGAffineTransformEqualToTransform(_affineTransform,_48)){
return;
}
_affineTransform={a:_48.a,b:_48.b,c:_48.c,d:_48.d,tx:_48.tx,ty:_48.ty};
_CALayerRecalculateGeometry(_46,_25);
}
}),new objj_method(sel_getUid("affineTransform"),function(_49,_4a){
with(_49){
return _affineTransform;
}
}),new objj_method(sel_getUid("setSublayerTransform:"),function(_4b,_4c,_4d){
with(_4b){
if(CGAffineTransformEqualToTransform(_sublayerTransform,_4d)){
return;
}
var _4e=_hasSublayerTransform;
_sublayerTransform={a:_4d.a,b:_4d.b,c:_4d.c,d:_4d.d,tx:_4d.tx,ty:_4d.ty};
_hasSublayerTransform=!(_sublayerTransform.a==1&&_sublayerTransform.b==0&&_sublayerTransform.c==0&&_sublayerTransform.d==1&&_sublayerTransform.tx==0&&_sublayerTransform.ty==0);
if(_hasSublayerTransform){
_CALayerUpdateSublayerTransformForSublayers(_4b);
var _4f=_sublayers.length;
while(_4f--){
_CALayerRecalculateGeometry(_sublayers[_4f],_26);
}
}
}
}),new objj_method(sel_getUid("sublayerTransform"),function(_50,_51){
with(_50){
return _sublayerTransform;
}
}),new objj_method(sel_getUid("transformToLayer"),function(_52,_53){
with(_52){
return _transformToLayer;
}
}),new objj_method(sel_getUid("setFrame:"),function(_54,_55,_56){
with(_54){
alert("FIXME IMPLEMENT");
}
}),new objj_method(sel_getUid("frame"),function(_57,_58){
with(_57){
if(!_frame){
_frame=objj_msgSend(_57,"convertRect:toLayer:",_bounds,_superlayer);
}
return _frame;
}
}),new objj_method(sel_getUid("backingStoreFrame"),function(_59,_5a){
with(_59){
return _backingStoreFrame;
}
}),new objj_method(sel_getUid("setBackingStoreFrame:"),function(_5b,_5c,_5d){
with(_5b){
_hasCustomBackingStoreFrame=(_5d!=nil);
if(_5d==nil){
_5d=CGRectMakeCopy(_standardBackingStoreFrame);
}else{
if(_superlayer){
_5d=objj_msgSend(_superlayer,"convertRect:toLayer:",_5d,nil);
var _5e=objj_msgSend(_superlayer,"bounds"),_5f=objj_msgSend(_superlayer,"convertRect:toLayer:",_5e,nil);
_5d.origin.x-=(_5f.origin.x);
_5d.origin.y-=(_5f.origin.y);
}else{
_5d=CGRectMakeCopy(_5d);
}
}
if(!CGPointEqualToPoint(_backingStoreFrame.origin,_5d.origin)){
objj_msgSend(_5b,"registerRunLoopUpdateWithMask:",_28);
}
if(!CGSizeEqualToSize(_backingStoreFrame.size,_5d.size)){
objj_msgSend(_5b,"registerRunLoopUpdateWithMask:",_29);
}
_backingStoreFrame=_5d;
}
}),new objj_method(sel_getUid("contents"),function(_60,_61){
with(_60){
return _contents;
}
}),new objj_method(sel_getUid("setContents:"),function(_62,_63,_64){
with(_62){
if(_contents==_64){
return;
}
_contents=_64;
objj_msgSend(_62,"composite");
}
}),new objj_method(sel_getUid("composite"),function(_65,_66){
with(_65){
if(_27&&!_contents||!_context){
return;
}
CGContextClearRect(_context,{origin:{x:0,y:0},size:{width:(_backingStoreFrame.size.width),height:(_backingStoreFrame.size.height)}});
var _67=_transformFromLayer;
if(_superlayer){
var _68=_CALayerGetTransform(_superlayer,nil),_69=CGPointApplyAffineTransform(_superlayer._bounds.origin,_68);
_67=CGAffineTransformConcat(_67,_68);
_67.tx-=_69.x;
_67.ty-=_69.y;
}
_67.tx-=(_backingStoreFrame.origin.x);
_67.ty-=(_backingStoreFrame.origin.y);
CGContextSaveGState(_context);
CGContextConcatCTM(_context,_67);
if(_27){
_context.drawImage(_contents.buffer,(_bounds.origin.x),(_bounds.origin.y));
}else{
objj_msgSend(_65,"drawInContext:",_context);
}
CGContextRestoreGState(_context);
}
}),new objj_method(sel_getUid("display"),function(_6a,_6b){
with(_6a){
if(!_context){
_context=CGBitmapGraphicsContextCreate();
_DOMContentsElement=_context.DOMElement;
_DOMContentsElement.style.zIndex=-100;
_DOMContentsElement.style.overflow="hidden";
_DOMContentsElement.style.position="absolute";
_DOMContentsElement.style.visibility="visible";
_DOMContentsElement.width=ROUND((_backingStoreFrame.size.width));
_DOMContentsElement.height=ROUND((_backingStoreFrame.size.height));
_DOMContentsElement.style.top="0px";
_DOMContentsElement.style.left="0px";
_DOMContentsElement.style.width=ROUND((_backingStoreFrame.size.width))+"px";
_DOMContentsElement.style.height=ROUND((_backingStoreFrame.size.height))+"px";
_DOMElement.appendChild(_DOMContentsElement);
}
if(_27){
if(_delegateRespondsToDisplayLayerSelector){
return objj_msgSend(_delegate,"displayInLayer:",_6a);
}
if((_backingStoreFrame.size.width)==0||(_backingStoreFrame.size.height)==0){
return;
}
if(!_contents){
_contents=CABackingStoreCreate();
}
CABackingStoreSetSize(_contents,_bounds.size);
objj_msgSend(_6a,"drawInContext:",CABackingStoreGetContext(_contents));
}
objj_msgSend(_6a,"composite");
}
}),new objj_method(sel_getUid("drawInContext:"),function(_6c,_6d,_6e){
with(_6c){
if(_backgroundColor){
CGContextSetFillColor(_6e,_backgroundColor);
CGContextFillRect(_6e,_bounds);
}
if(_delegateRespondsToDrawLayerInContextSelector){
objj_msgSend(_delegate,"drawLayer:inContext:",_6c,_6e);
}
}
}),new objj_method(sel_getUid("opacity"),function(_6f,_70){
with(_6f){
return _opacity;
}
}),new objj_method(sel_getUid("setOpacity:"),function(_71,_72,_73){
with(_71){
if(_opacity==_73){
return;
}
_opacity=_73;
_DOMElement.style.opacity=_73;
_DOMElement.style.filter="alpha(opacity="+_73*100+")";
}
}),new objj_method(sel_getUid("setHidden:"),function(_74,_75,_76){
with(_74){
_isHidden=_76;
_DOMElement.style.display=_76?"none":"block";
}
}),new objj_method(sel_getUid("hidden"),function(_77,_78){
with(_77){
return _isHidden;
}
}),new objj_method(sel_getUid("isHidden"),function(_79,_7a){
with(_79){
return _isHidden;
}
}),new objj_method(sel_getUid("setMasksToBounds:"),function(_7b,_7c,_7d){
with(_7b){
if(_masksToBounds==_7d){
return;
}
_masksToBounds=_7d;
_DOMElement.style.overflow=_masksToBounds?"hidden":"visible";
}
}),new objj_method(sel_getUid("setBackgroundColor:"),function(_7e,_7f,_80){
with(_7e){
_backgroundColor=_80;
objj_msgSend(_7e,"setNeedsDisplay");
}
}),new objj_method(sel_getUid("backgroundColor"),function(_81,_82){
with(_81){
return _backgroundColor;
}
}),new objj_method(sel_getUid("sublayers"),function(_83,_84){
with(_83){
return _sublayers;
}
}),new objj_method(sel_getUid("superlayer"),function(_85,_86){
with(_85){
return _superlayer;
}
}),new objj_method(sel_getUid("addSublayer:"),function(_87,_88,_89){
with(_87){
objj_msgSend(_87,"insertSublayer:atIndex:",_89,_sublayers.length);
return;
if(_DOMContentsElement&&_89._zPosition>_DOMContentsElement.style.zIndex){
_DOMContentsElement.style.zIndex-=100;
}
objj_msgSend(_sublayers,"addObject:",_89);
_DOMElement.appendChild(_89._DOMElement);
}
}),new objj_method(sel_getUid("removeFromSuperlayer"),function(_8a,_8b){
with(_8a){
if(_owningView){
objj_msgSend(_owningView,"setLayer:",nil);
}
if(!_superlayer){
return;
}
_superlayer._DOMElement.removeChild(_DOMElement);
objj_msgSend(_superlayer._sublayers,"removeObject:",_8a);
_superlayer=nil;
}
}),new objj_method(sel_getUid("insertSublayer:atIndex:"),function(_8c,_8d,_8e,_8f){
with(_8c){
if(!_8e){
return;
}
var _90=objj_msgSend(_8e,"superlayer");
if(_90==_8c){
var _91=objj_msgSend(_sublayers,"indexOfObjectIdenticalTo:",_8e);
if(_91==_8f){
return;
}
objj_msgSend(_sublayers,"removeObjectAtIndex:",_91);
if(_91<_8f){
--_8f;
}
}else{
if(_90!=nil){
objj_msgSend(_8e,"removeFromSuperlayer");
}
}
if(_DOMContentsElement&&_8e._zPosition>_DOMContentsElement.style.zIndex){
_DOMContentsElement.style.zIndex-=100;
}
objj_msgSend(_sublayers,"insertObject:atIndex:",_8e,_8f);
if(_8f>=_sublayers.length-1){
_DOMElement.appendChild(_8e._DOMElement);
}else{
_DOMElement.insertBefore(_8e._DOMElement,_sublayers[_8f+1]._DOMElement);
}
_8e._superlayer=_8c;
if(_8c!=_90){
_CALayerRecalculateGeometry(_8e,268435455);
}
}
}),new objj_method(sel_getUid("insertSublayer:below:"),function(_92,_93,_94,_95){
with(_92){
var _96=_95?objj_msgSend(_sublayers,"indexOfObjectIdenticalTo:",_95):0;
objj_msgSend(_92,"insertSublayer:atIndex:",_94,_96==CPNotFound?_sublayers.length:_96);
}
}),new objj_method(sel_getUid("insertSublayer:above:"),function(_97,_98,_99,_9a){
with(_97){
var _9b=_9a?objj_msgSend(_sublayers,"indexOfObjectIdenticalTo:",_9a):_sublayers.length;
if(_9b==CPNotFound){
objj_msgSend(CPException,"raise:reason:","CALayerNotFoundException","aSublayer is not a sublayer of this layer");
}
objj_msgSend(_sublayers,"insertObject:atIndex:",_99,_9b==CPNotFound?_sublayers.length:_9b+1);
}
}),new objj_method(sel_getUid("replaceSublayer:with:"),function(_9c,_9d,_9e,_9f){
with(_9c){
if(_9e==_9f){
return;
}
if(_9e._superlayer!=_9c){
alert("EXCEPTION");
return;
}
if(_DOMContentsElement&&_9f._zPosition>_DOMContentsElement.style.zIndex){
_DOMContentsElement.style.zIndex-=100;
}
objj_msgSend(_sublayers,"replaceObjectAtIndex:withObject:",objj_msgSend(_sublayers,"indexOfObjectIdenticalTo:",_9e),_9f);
_DOMElement.replaceChild(_9e._DOMElement,_9f._DOMElement);
}
}),new objj_method(sel_getUid("registerRunLoopUpdateWithMask:"),function(_a0,_a1,_a2){
with(_a0){
if(_2e==nil){
_2e={};
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"performSelector:target:argument:order:modes:",sel_getUid("runLoopUpdateLayers"),CALayer,nil,0,[CPDefaultRunLoopMode]);
}
_runLoopUpdateMask|=_a2;
_2e[objj_msgSend(_a0,"UID")]=_a0;
}
}),new objj_method(sel_getUid("setNeedsComposite"),function(_a3,_a4){
with(_a3){
objj_msgSend(_a3,"registerRunLoopUpdateWithMask:",_2c);
}
}),new objj_method(sel_getUid("setNeedsDisplay"),function(_a5,_a6){
with(_a5){
objj_msgSend(_a5,"registerRunLoopUpdateWithMask:",_2b);
}
}),new objj_method(sel_getUid("setNeedsDisplayOnBoundsChange:"),function(_a7,_a8,_a9){
with(_a7){
_needsDisplayOnBoundsChange=_a9;
}
}),new objj_method(sel_getUid("needsDisplayOnBoundsChange"),function(_aa,_ab){
with(_aa){
return _needsDisplayOnBoundsChange;
}
}),new objj_method(sel_getUid("setNeedsDisplayInRect:"),function(_ac,_ad,_ae){
with(_ac){
_dirtyRect=_ae;
objj_msgSend(_ac,"display");
}
}),new objj_method(sel_getUid("convertPoint:fromLayer:"),function(_af,_b0,_b1,_b2){
with(_af){
return CGPointApplyAffineTransform(_b1,_CALayerGetTransform(_b2,_af));
}
}),new objj_method(sel_getUid("convertPoint:toLayer:"),function(_b3,_b4,_b5,_b6){
with(_b3){
return CGPointApplyAffineTransform(_b5,_CALayerGetTransform(_b3,_b6));
}
}),new objj_method(sel_getUid("convertRect:fromLayer:"),function(_b7,_b8,_b9,_ba){
with(_b7){
return CGRectApplyAffineTransform(_b9,_CALayerGetTransform(_ba,_b7));
}
}),new objj_method(sel_getUid("convertRect:toLayer:"),function(_bb,_bc,_bd,_be){
with(_bb){
return CGRectApplyAffineTransform(_bd,_CALayerGetTransform(_bb,_be));
}
}),new objj_method(sel_getUid("containsPoint:"),function(_bf,_c0,_c1){
with(_bf){
return (_c1.x>=(_bounds.origin.x)&&_c1.y>=(_bounds.origin.y)&&_c1.x<(_bounds.origin.x+_bounds.size.width)&&_c1.y<(_bounds.origin.y+_bounds.size.height));
}
}),new objj_method(sel_getUid("hitTest:"),function(_c2,_c3,_c4){
with(_c2){
if(_isHidden){
return nil;
}
var _c5=CGPointApplyAffineTransform(_c4,_transformToLayer);
if(!(_c5.x>=(_bounds.origin.x)&&_c5.y>=(_bounds.origin.y)&&_c5.x<(_bounds.origin.x+_bounds.size.width)&&_c5.y<(_bounds.origin.y+_bounds.size.height))){
return nil;
}
var _c6=nil,_c7=_sublayers.length;
while(_c7--){
if(_c6=objj_msgSend(_sublayers[_c7],"hitTest:",_c5)){
return _c6;
}
}
return _c2;
}
}),new objj_method(sel_getUid("setDelegate:"),function(_c8,_c9,_ca){
with(_c8){
if(_delegate==_ca){
return;
}
_delegate=_ca;
_delegateRespondsToDisplayLayerSelector=objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("displayLayer:"));
_delegateRespondsToDrawLayerInContextSelector=objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("drawLayer:inContext:"));
if(_delegateRespondsToDisplayLayerSelector||_delegateRespondsToDrawLayerInContextSelector){
objj_msgSend(_c8,"setNeedsDisplay");
}
}
}),new objj_method(sel_getUid("delegate"),function(_cb,_cc){
with(_cb){
return _delegate;
}
}),new objj_method(sel_getUid("_setOwningView:"),function(_cd,_ce,_cf){
with(_cd){
_owningView=_cf;
if(_owningView){
_owningView=_cf;
_bounds.size=CGSizeMakeCopy(objj_msgSend(_owningView,"bounds").size);
_position=CGPointMake((_bounds.size.width)*_anchorPoint.x,(_bounds.size.height)*_anchorPoint.y);
}
_CALayerRecalculateGeometry(_cd,_23|_22);
}
}),new objj_method(sel_getUid("_owningViewBoundsChanged"),function(_d0,_d1){
with(_d0){
_bounds.size=CGSizeMakeCopy(objj_msgSend(_owningView,"bounds").size);
_position=CGPointMake((_bounds.size.width)*_anchorPoint.x,(_bounds.size.height)*_anchorPoint.y);
_CALayerRecalculateGeometry(_d0,_23|_22);
}
}),new objj_method(sel_getUid("_update"),function(_d2,_d3){
with(_d2){
window.loop=true;
var _d4=_runLoopUpdateMask;
if(_d4&_2d){
_CALayerUpdateDOM(_d2,_d4);
}
if(_d4&_2b){
objj_msgSend(_d2,"display");
}else{
if(_d4&_29||_d4&_2c){
objj_msgSend(_d2,"composite");
}
}
_runLoopUpdateMask=0;
window.loop=false;
}
})]);
class_addMethods(_30,[new objj_method(sel_getUid("layer"),function(_d5,_d6){
with(_d5){
return objj_msgSend(objj_msgSend(objj_msgSend(_d5,"class"),"alloc"),"init");
}
}),new objj_method(sel_getUid("runLoopUpdateLayers"),function(_d7,_d8){
with(_d7){
for(UID in _2e){
var _d9=_2e[UID],_da=_d9._runLoopUpdateMask;
if(_da&_2d){
_CALayerUpdateDOM(_d9,_da);
}
if(_da&_2b){
objj_msgSend(_d9,"display");
}else{
if(_da&_29||_da&_2c){
objj_msgSend(_d9,"composite");
}
}
_d9._runLoopUpdateMask=0;
}
window.loop=false;
_2e=nil;
}
})]);
_CALayerUpdateSublayerTransformForSublayers=function(_db){
var _dc=_db._bounds,_dd=_db._anchorPoint,_de=(_dc.size.width)*_dd.x,_df=(_dc.size.height)*_dd.y;
_db._sublayerTransformForSublayers=CGAffineTransformConcat(CGAffineTransformMakeTranslation(-_de,-_df),CGAffineTransformConcat(_db._sublayerTransform,CGAffineTransformMakeTranslation(_de,_df)));
};
_CALayerUpdateDOM=function(_e0,_e1){
var _e2=_e0._DOMElement.style;
if(_e1&_2a){
_e2.zIndex=_e0._zPosition;
}
var _e3=_e0._backingStoreFrame;
if(_e1&_28){
_e2.top=ROUND((_e3.origin.y))+"px";
_e2.left=ROUND((_e3.origin.x))+"px";
}
if(_e1&_29){
var _e4=MAX(0,ROUND((_e3.size.width))),_e5=MAX(0,ROUND((_e3.size.height))),_e6=_e0._DOMContentsElement;
_e2.width=_e4+"px";
_e2.height=_e5+"px";
if(_e6){
_e6.width=_e4;
_e6.height=_e5;
_e6.style.width=_e4+"px";
_e6.style.height=_e5+"px";
}
}
};
_CALayerRecalculateGeometry=function(_e7,_e8){
var _e9=_e7._bounds,_ea=_e7._superlayer,_eb=(_e9.size.width),_ec=(_e9.size.height),_ed=_e7._position,_ee=_e7._anchorPoint,_ef=_e7._affineTransform,_f0={width:_e7._backingStoreFrame.width,height:_e7._backingStoreFrame.height},_f1=_e7._hasCustomBackingStoreFrame;
_e7._transformFromLayer=CGAffineTransformConcat(CGAffineTransformMakeTranslation(-_eb*_ee.x-(_e7._bounds.origin.x),-_ec*_ee.y-(_e7._bounds.origin.y)),CGAffineTransformConcat(_ef,CGAffineTransformMakeTranslation(_ed.x,_ed.y)));
if(_ea&&_ea._hasSublayerTransform){
var tx=_e7._transformFromLayer.tx*_ea._sublayerTransformForSublayers.a+_e7._transformFromLayer.ty*_ea._sublayerTransformForSublayers.c+_ea._sublayerTransformForSublayers.tx;
_e7._transformFromLayer.ty=_e7._transformFromLayer.tx*_ea._sublayerTransformForSublayers.b+_e7._transformFromLayer.ty*_ea._sublayerTransformForSublayers.d+_ea._sublayerTransformForSublayers.ty;
_e7._transformFromLayer.tx=tx;
var a=_e7._transformFromLayer.a*_ea._sublayerTransformForSublayers.a+_e7._transformFromLayer.b*_ea._sublayerTransformForSublayers.c,b=_e7._transformFromLayer.a*_ea._sublayerTransformForSublayers.b+_e7._transformFromLayer.b*_ea._sublayerTransformForSublayers.d,c=_e7._transformFromLayer.c*_ea._sublayerTransformForSublayers.a+_e7._transformFromLayer.d*_ea._sublayerTransformForSublayers.c;
_e7._transformFromLayer.d=_e7._transformFromLayer.c*_ea._sublayerTransformForSublayers.b+_e7._transformFromLayer.d*_ea._sublayerTransformForSublayers.d;
_e7._transformFromLayer.a=a;
_e7._transformFromLayer.b=b;
_e7._transformFromLayer.c=c;
}
_e7._transformToLayer=CGAffineTransformInvert(_e7._transformFromLayer);
_e7._frame=nil;
_e7._standardBackingStoreFrame=objj_msgSend(_e7,"convertRect:toLayer:",_e9,nil);
if(_ea){
var _e9=objj_msgSend(_ea,"bounds"),_f2=objj_msgSend(_ea,"convertRect:toLayer:",_e9,nil);
_e7._standardBackingStoreFrame.origin.x-=(_f2.origin.x);
_e7._standardBackingStoreFrame.origin.y-=(_f2.origin.y);
}
var _f3=_e7._standardBackingStoreFrame.origin,_f4=_e7._standardBackingStoreFrame.size;
_f3.x=FLOOR(_f3.x);
_f3.y=FLOOR(_f3.y);
_f4.width=CEIL(_f4.width)+1;
_f4.height=CEIL(_f4.height)+1;
if(!_f1){
var _f5=CGRectMakeCopy(_e7._standardBackingStoreFrame);
if(ROUND((_f5.origin.x))!=ROUND((_e7._backingStoreFrame.origin.x))||ROUND((_f5.origin.y))!=ROUND((_e7._backingStoreFrame.origin.y))){
objj_msgSend(_e7,"registerRunLoopUpdateWithMask:",_28);
}
if(((_f5.size.width)!=ROUND((_e7._backingStoreFrame.size.width))||(_f5.size.height)!=ROUND((_e7._backingStoreFrame.size.height)))){
objj_msgSend(_e7,"registerRunLoopUpdateWithMask:",_29);
}
_e7._backingStoreFrame=_f5;
}
if(_e8&_22&&_e7._needsDisplayOnBoundsChange){
objj_msgSend(_e7,"setNeedsDisplay");
}else{
if(_f1||(_e8&~(_23|_24))){
objj_msgSend(_e7,"setNeedsComposite");
}
}
var _f6=_e7._sublayers,_f7=0,_f8=_f6.length;
for(;_f7<_f8;++_f7){
_CALayerRecalculateGeometry(_f6[_f7],_e8);
}
};
_CALayerGetTransform=function(_f9,_fa){
var _fb=CGAffineTransformMakeIdentity();
if(_f9){
var _fc=_f9;
while(_fc&&_fc!=_fa){
var _fd=_fc._transformFromLayer;
var tx=_fb.tx*_fd.a+_fb.ty*_fd.c+_fd.tx;
_fb.ty=_fb.tx*_fd.b+_fb.ty*_fd.d+_fd.ty;
_fb.tx=tx;
var a=_fb.a*_fd.a+_fb.b*_fd.c,b=_fb.a*_fd.b+_fb.b*_fd.d,c=_fb.c*_fd.a+_fb.d*_fd.c;
_fb.d=_fb.c*_fd.b+_fb.d*_fd.d;
_fb.a=a;
_fb.b=b;
_fb.c=c;
_fc=_fc._superlayer;
}
if(_fc==_fa){
return _fb;
}
}
var _fe=[],_fc=_fa;
while(_fc){
_fe.push(_fc);
_fc=_fc._superlayer;
}
var _ff=_fe.length;
while(_ff--){
var _100=_fe[_ff]._transformToLayer;
var tx=_fb.tx*_100.a+_fb.ty*_100.c+_100.tx;
_fb.ty=_fb.tx*_100.b+_fb.ty*_100.d+_100.ty;
_fb.tx=tx;
var a=_fb.a*_100.a+_fb.b*_100.c,b=_fb.a*_100.b+_fb.b*_100.d,c=_fb.c*_100.a+_fb.d*_100.c;
_fb.d=_fb.c*_100.b+_fb.d*_100.d;
_fb.a=a;
_fb.b=b;
_fb.c=c;
}
return _fb;
};
p;23;CAMediaTimingFunction.jt;2263;@STATIC;1.0;I;21;Foundation/CPObject.jI;25;Foundation/CPDictionary.jI;21;Foundation/CPString.jt;2162;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("Foundation/CPDictionary.j",NO);
objj_executeFile("Foundation/CPString.j",NO);
kCAMediaTimingFunctionLinear="kCAMediaTimingFunctionLinear";
kCAMediaTimingFunctionEaseIn="kCAMediaTimingFunctionEaseIn";
kCAMediaTimingFunctionEaseOut="kCAMediaTimingFunctionEaseOut";
kCAMediaTimingFunctionEaseInEaseOut="kCAMediaTimingFunctionEaseInEaseOut";
var _1=nil;
var _2=objj_allocateClassPair(CPObject,"CAMediaTimingFunction"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_c1x"),new objj_ivar("_c1y"),new objj_ivar("_c2x"),new objj_ivar("_c2y")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("initWithControlPoints::::"),function(_4,_5,_6,_7,_8,_9){
with(_4){
_4=objj_msgSendSuper({receiver:_4,super_class:objj_getClass("CAMediaTimingFunction").super_class},"init");
if(_4){
_c1x=_6;
_c1y=_7;
_c2x=_8;
_c2y=_9;
}
return _4;
}
}),new objj_method(sel_getUid("getControlPointAtIndex:values:"),function(_a,_b,_c,_d){
with(_a){
if(_c==0){
_d[0]=0;
_d[1]=0;
}else{
if(_c==1){
_d[0]=_c1x;
_d[1]=_c1y;
}else{
if(_c==2){
_d[0]=_c2x;
_d[1]=_c2y;
}else{
_d[0]=1;
_d[1]=1;
}
}
}
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("functionWithName:"),function(_e,_f,_10){
with(_e){
if(!_1){
_1=objj_msgSend(CPDictionary,"dictionary");
objj_msgSend(_1,"setObject:forKey:",objj_msgSend(CAMediaTimingFunction,"functionWithControlPoints::::",0,0,1,1),kCAMediaTimingFunctionLinear);
objj_msgSend(_1,"setObject:forKey:",objj_msgSend(CAMediaTimingFunction,"functionWithControlPoints::::",0.42,0,1,1),kCAMediaTimingFunctionEaseIn);
objj_msgSend(_1,"setObject:forKey:",objj_msgSend(CAMediaTimingFunction,"functionWithControlPoints::::",0,0,0.58,1),kCAMediaTimingFunctionEaseOut);
objj_msgSend(_1,"setObject:forKey:",objj_msgSend(CAMediaTimingFunction,"functionWithControlPoints::::",0.42,0,0.58,1),kCAMediaTimingFunctionEaseInEaseOut);
}
return objj_msgSend(_1,"objectForKey:",_10);
}
}),new objj_method(sel_getUid("functionWithControlPoints::::"),function(_11,_12,c1x,c1y,c2x,c2y){
with(_11){
return objj_msgSend(objj_msgSend(_11,"alloc"),"initWithControlPoints::::",c1x,c1y,c2x,c2y);
}
})]);
p;19;CGAffineTransform.jt;2936;@STATIC;1.0;i;12;CGGeometry.jt;2900;
objj_executeFile("CGGeometry.j",YES);
CGAffineTransformMake=function(a,b,c,d,tx,ty){
return {a:a,b:b,c:c,d:d,tx:tx,ty:ty};
};
CGAffineTransformMakeIdentity=function(){
return {a:1,b:0,c:0,d:1,tx:0,ty:0};
};
CGAffineTransformMakeCopy=function(_1){
return {a:_1.a,b:_1.b,c:_1.c,d:_1.d,tx:_1.tx,ty:_1.ty};
};
CGAffineTransformMakeScale=function(sx,sy){
return {a:sx,b:0,c:0,d:sy,tx:0,ty:0};
};
CGAffineTransformMakeTranslation=function(tx,ty){
return {a:1,b:0,c:0,d:1,tx:tx,ty:ty};
};
CGAffineTransformTranslate=function(_2,tx,ty){
return {a:_2.a,b:_2.b,c:_2.c,d:_2.d,tx:_2.tx+_2.a*tx+_2.c*ty,ty:_2.ty+_2.b*tx+_2.d*ty};
};
CGAffineTransformScale=function(_3,sx,sy){
return {a:_3.a*sx,b:_3.b*sx,c:_3.c*sy,d:_3.d*sy,tx:_3.tx,ty:_3.ty};
};
CGAffineTransformConcat=function(_4,_5){
return {a:_4.a*_5.a+_4.b*_5.c,b:_4.a*_5.b+_4.b*_5.d,c:_4.c*_5.a+_4.d*_5.c,d:_4.c*_5.b+_4.d*_5.d,tx:_4.tx*_5.a+_4.ty*_5.c+_5.tx,ty:_4.tx*_5.b+_4.ty*_5.d+_5.ty};
};
CGPointApplyAffineTransform=function(_6,_7){
return {x:_6.x*_7.a+_6.y*_7.c+_7.tx,y:_6.x*_7.b+_6.y*_7.d+_7.ty};
};
CGSizeApplyAffineTransform=function(_8,_9){
return {width:_8.width*_9.a+_8.height*_9.c,height:_8.width*_9.b+_8.height*_9.d};
};
CGAffineTransformIsIdentity=function(_a){
return (_a.a==1&&_a.b==0&&_a.c==0&&_a.d==1&&_a.tx==0&&_a.ty==0);
};
CGAffineTransformEqualToTransform=function(_b,_c){
return (_b.a==_c.a&&_b.b==_c.b&&_b.c==_c.c&&_b.d==_c.d&&_b.tx==_c.tx&&_b.ty==_c.ty);
};
CGStringCreateWithCGAffineTransform=function(_d){
return (" [[ "+_d.a+", "+_d.b+", 0 ], [ "+_d.c+", "+_d.d+", 0 ], [ "+_d.tx+", "+_d.ty+", 1]]");
};
CGAffineTransformCreateCopy=function(_e){
return {a:_e.a,b:_e.b,c:_e.c,d:_e.d,tx:_e.tx,ty:_e.ty};
};
CGAffineTransformMakeRotation=function(_f){
var sin=SIN(_f),cos=COS(_f);
return {a:cos,b:sin,c:-sin,d:cos,tx:0,ty:0};
};
CGAffineTransformRotate=function(_10,_11){
var sin=SIN(_11),cos=COS(_11);
return {a:_10.a*cos+_10.c*sin,b:_10.b*cos+_10.d*sin,c:_10.c*cos-_10.a*sin,d:_10.d*cos-_10.b*sin,tx:_10.tx,ty:_10.ty};
};
CGAffineTransformInvert=function(_12){
var _13=1/(_12.a*_12.d-_12.b*_12.c);
return {a:_13*_12.d,b:-_13*_12.b,c:-_13*_12.c,d:_13*_12.a,tx:_13*(_12.c*_12.ty-_12.d*_12.tx),ty:_13*(_12.b*_12.tx-_12.a*_12.ty)};
};
CGRectApplyAffineTransform=function(_14,_15){
var top=(_14.origin.y),_16=(_14.origin.x),_17=(_14.origin.x+_14.size.width),_18=(_14.origin.y+_14.size.height),_19=CGPointApplyAffineTransform({x:_16,y:top},_15),_1a=CGPointApplyAffineTransform({x:_17,y:top},_15),_1b=CGPointApplyAffineTransform({x:_16,y:_18},_15),_1c=CGPointApplyAffineTransform({x:_17,y:_18},_15),_1d=MIN(_19.x,_1a.x,_1b.x,_1c.x),_1e=MAX(_19.x,_1a.x,_1b.x,_1c.x),_1f=MIN(_19.y,_1a.y,_1b.y,_1c.y),_20=MAX(_19.y,_1a.y,_1b.y,_1c.y);
return {origin:{x:_1d,y:_1f},size:{width:(_1e-_1d),height:(_20-_1f)}};
};
CPStringFromCGAffineTransform=function(_21){
return "{"+_21.a+", "+_21.b+", "+_21.c+", "+_21.d+", "+_21.tx+", "+_21.ty+"}";
};
p;9;CGColor.jt;2143;@STATIC;1.0;i;14;CGColorSpace.jt;2105;
objj_executeFile("CGColorSpace.j",YES);
var _1=0;
CFHashCode=function(_2){
if(!_2.hash){
_2.hash=++_1;
}
return _2;
};
kCGColorWhite="kCGColorWhite";
kCGColorBlack="kCGColorBlack";
kCGColorClear="kCGColorClear";
var _3={};
CGColorGetConstantColor=function(_4){
alert("FIX ME");
};
CGColorRetain=function(_5){
return _5;
};
CGColorRelease=function(){
};
CGColorCreate=function(_6,_7){
if(!_6||!_7){
return NULL;
}
var _7=_7.slice();
CGColorSpaceStandardizeComponents(_6,_7);
var _8=CFHashCode(_6)+_7.join("");
if(_3[_8]){
return _3[_8];
}
return _3[_8]={colorspace:_6,pattern:NULL,components:_7};
};
CGColorCreateCopy=function(_9){
return _9;
};
CGColorCreateGenericGray=function(_a,_b){
return CGColorCreate(0,[_a,_b]);
};
CGColorCreateGenericRGB=function(_c,_d,_e,_f){
return CGColorCreate(0,[_c,_d,_e,_f]);
};
CGColorCreateGenericCMYK=function(_10,_11,_12,_13,_14){
return CGColorCreate(0,[_10,_11,_12,_13,_14]);
};
CGColorCreateCopyWithAlpha=function(_15,_16){
var _17=_15.components;
if(!_15||_16==_17[_17.length-1]){
return _15;
}
if(_15.pattern){
var _18=CGColorCreateWithPattern(_15.colorspace,_15.pattern,_17);
}else{
var _18=CGColorCreate(_15.colorspace,_17);
}
_18.components[_17.length-1]=_16;
return _18;
};
CGColorCreateWithPattern=function(_19,_1a,_1b){
if(!_19||!_1a||!_1b){
return NULL;
}
return {colorspace:_19,pattern:_1a,components:_1b.slice()};
};
CGColorEqualToColor=function(lhs,rhs){
if(lhs==rhs){
return true;
}
if(!lhs||!rhs){
return false;
}
var _1c=lhs.components,_1d=rhs.components,_1e=_1c.length;
if(_1e!=_1d.length){
return false;
}
while(_1e--){
if(_1c[_1e]!=_1d[_1e]){
return false;
}
}
if(lhs.pattern!=rhs.pattern){
return false;
}
if(CGColorSpaceEqualToColorSpace(lhs.colorspace,rhs.colorspace)){
return false;
}
return true;
};
CGColorGetAlpha=function(_1f){
var _20=_1f.components;
return _20[_20.length-1];
};
CGColorGetColorSpace=function(_21){
return _21.colorspace;
};
CGColorGetComponents=function(_22){
return _22.components;
};
CGColorGetNumberOfComponents=function(_23){
return _23.components.length;
};
CGColorGetPattern=function(_24){
return _24.pattern;
};
p;14;CGColorSpace.jt;3521;@STATIC;1.0;t;3502;
kCGColorSpaceModelUnknown=-1;
kCGColorSpaceModelMonochrome=0;
kCGColorSpaceModelRGB=1;
kCGColorSpaceModelCMYK=2;
kCGColorSpaceModelLab=3;
kCGColorSpaceModelDeviceN=4;
kCGColorSpaceModelIndexed=5;
kCGColorSpaceModelPattern=6;
kCGColorSpaceGenericGray="CGColorSpaceGenericGray";
kCGColorSpaceGenericRGB="CGColorSpaceGenericRGB";
kCGColorSpaceGenericCMYK="CGColorSpaceGenericCMYK";
kCGColorSpaceGenericRGBLinear="CGColorSpaceGenericRGBLinear";
kCGColorSpaceGenericRGBHDR="CGColorSpaceGenericRGBHDR";
kCGColorSpaceAdobeRGB1998="CGColorSpaceAdobeRGB1998";
kCGColorSpaceSRGB="CGColorSpaceSRGB";
var _1={};
CGColorSpaceCreateCalibratedGray=function(_2,_3,_4){
return {model:kCGColorSpaceModelMonochrome,count:1,base:NULL};
};
CGColorSpaceCreateCalibratedRGB=function(_5,_6,_7){
return {model:kCGColorSpaceModelRGB,count:1,base:NULL};
};
CGColorSpaceCreateICCBased=function(_8,_9,_a,_b){
return NULL;
};
CGColorSpaceCreateLab=function(_c,_d,_e){
return NULL;
};
CGColorSpaceCreateDeviceCMYK=function(){
return CGColorSpaceCreateWithName(kCGColorSpaceGenericCMYK);
};
CGColorSpaceCreateDeviceGray=function(){
return CGColorSpaceCreateWithName(kCGColorSpaceGenericGray);
};
CGColorSpaceCreateDeviceRGB=function(){
return CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
};
CGColorSpaceCreateWithPlatformColorSpace=function(){
return NULL;
};
CGColorSpaceCreateIndexed=function(_f,_10,_11){
return NULL;
};
CGColorSpaceCreatePattern=function(_12){
if(_12){
return {model:kCGColorSpaceModelPattern,count:_12.count,base:_12};
}
return {model:kCGColorSpaceModelPattern,count:0,base:NULL};
};
CGColorSpaceCreateWithName=function(_13){
var _14=_1[_13];
if(_14){
return _14;
}
switch(_13){
case kCGColorSpaceGenericGray:
return _1[_13]={model:kCGColorSpaceModelMonochrome,count:1,base:NULL};
case kCGColorSpaceGenericRGB:
return _1[_13]={model:kCGColorSpaceModelRGB,count:3,base:NULL};
case kCGColorSpaceGenericCMYK:
return _1[_13]={model:kCGColorSpaceModelCMYK,count:4,base:NULL};
case kCGColorSpaceGenericRGBLinear:
return _1[_13]={model:kCGColorSpaceModelRGB,count:3,base:NULL};
case kCGColorSpaceGenericRGBHDR:
return _1[_13]={model:kCGColorSpaceModelRGB,count:3,base:NULL};
case kCGColorSpaceAdobeRGB1998:
return _1[_13]={model:kCGColorSpaceModelRGB,count:3,base:NULL};
case kCGColorSpaceSRGB:
return _1[_13]={model:kCGColorSpaceModelRGB,count:3,base:NULL};
}
return NULL;
};
CGColorSpaceCopyICCProfile=function(_15){
return NULL;
};
CGColorSpaceGetNumberOfComponents=function(_16){
return _16.count;
};
CGColorSpaceGetTypeID=function(_17){
};
CGColorSpaceGetModel=function(_18){
return _18.model;
};
CGColorSpaceGetBaseColorSpace=function(_19){
};
CGColorSpaceGetColorTableCount=function(_1a){
};
CGColorSpaceGetColorTable=function(_1b){
};
CGColorSpaceRelease=function(_1c){
};
CGColorSpaceRetain=function(_1d){
return _1d;
};
CGColorSpaceStandardizeComponents=function(_1e,_1f){
var _20=_1e.count;
if(_20>_1f.length){
_1f[_20]=1;
return;
}
var _21=_1f[_20];
if(_21<0){
_1f[_20]=0;
}else{
if(_21>1){
_1f[_20]=1;
}else{
_1f[_20]=ROUND(_21*1000)/1000;
}
}
if(_1e.base){
_1e=_1e.base;
}
switch(_1e.model){
case kCGColorSpaceModelMonochrome:
case kCGColorSpaceModelRGB:
case kCGColorSpaceModelCMYK:
case kCGColorSpaceModelDeviceN:
while(_20--){
if(_20>_1f.length){
_1f[_20]=1;
return;
}
var _21=_1f[_20];
if(_21<0){
_1f[_20]=0;
}else{
if(_21>1){
_1f[_20]=1;
}else{
_1f[_20]=ROUND(_21*255)/255;
}
}
}
break;
case kCGColorSpaceModelIndexed:
case kCGColorSpaceModelLab:
case kCGColorSpaceModelPattern:
break;
}
};
p;11;CGContext.jt;20418;@STATIC;1.0;i;12;CGGeometry.ji;19;CGAffineTransform.ji;8;CGPath.jt;20345;
objj_executeFile("CGGeometry.j",YES);
objj_executeFile("CGAffineTransform.j",YES);
objj_executeFile("CGPath.j",YES);
kCGLineCapButt=0;
kCGLineCapRound=1;
kCGLineCapSquare=2;
kCGLineJoinMiter=0;
kCGLineJoinRound=1;
kCGLineJoinBevel=2;
kCGPathFill=0;
kCGPathEOFill=1;
kCGPathStroke=2;
kCGPathFillStroke=3;
kCGPathEOFillStroke=4;
kCGBlendModeNormal=0;
kCGBlendModeMultiply=1;
kCGBlendModeScreen=2;
kCGBlendModeOverlay=3;
kCGBlendModeDarken=4;
kCGBlendModeLighten=5;
kCGBlendModeColorDodge=6;
kCGBlendModeColorBurn=7;
kCGBlendModeSoftLight=8;
kCGBlendModeHardLight=9;
kCGBlendModeDifference=10;
kCGBlendModeExclusion=11;
kCGBlendModeHue=12;
kCGBlendModeSaturation=13;
kCGBlendModeColor=14;
kCGBlendModeLuminosity=15;
kCGBlendModeClear=16;
kCGBlendModeCopy=17;
kCGBlendModeSourceIn=18;
kCGBlendModeSourceOut=19;
kCGBlendModeSourceAtop=20;
kCGBlendModeDestinationOver=21;
kCGBlendModeDestinationIn=22;
kCGBlendModeDestinationOut=23;
kCGBlendModeDestinationAtop=24;
kCGBlendModeXOR=25;
kCGBlendModePlusDarker=26;
kCGBlendModePlusLighter=27;
CGContextRelease=function(){
};
CGContextRetain=function(_1){
return _1;
};
if(!CPFeatureIsCompatible(CPHTMLCanvasFeature)){
CGGStateCreate=function(){
return {alpha:1,strokeStyle:"#000",fillStyle:"#ccc",lineWidth:1,lineJoin:kCGLineJoinMiter,lineCap:kCGLineCapButt,miterLimit:10,globalAlpha:1,blendMode:kCGBlendModeNormal,shadowOffset:{width:0,height:0},shadowBlur:0,shadowColor:NULL,CTM:{a:1,b:0,c:0,d:1,tx:0,ty:0}};
};
CGGStateCreateCopy=function(_2){
return {alpha:_2.alpha,strokeStyle:_2.strokeStyle,fillStyle:_2.fillStyle,lineWidth:_2.lineWidth,lineJoin:_2.lineJoin,lineCap:_2.lineCap,miterLimit:_2.miterLimit,globalAlpha:_2.globalAlpha,blendMode:_2.blendMode,shadowOffset:_2.shadowOffset,shadowBlur:_2.shadowBlur,shadowColor:_2.shadowColor,CTM:{a:_2.CTM.a,b:_2.CTM.b,c:_2.CTM.c,d:_2.CTM.d,tx:_2.CTM.tx,ty:_2.CTM.ty}};
};
CGBitmapGraphicsContextCreate=function(){
return {DOMElement:document.createElement("div"),path:NULL,gState:CGGStateCreate(),gStateStack:[]};
};
CGContextSaveGState=function(_3){
_3.gStateStack.push(CGGStateCreateCopy(_3.gState));
};
CGContextRestoreGState=function(_4){
_4.gState=_4.gStateStack.pop();
};
CGContextSetLineCap=function(_5,_6){
_5.gState.lineCap=_6;
};
CGContextSetLineJoin=function(_7,_8){
_7.gState.lineJoin=_8;
};
CGContextSetLineWidth=function(_9,_a){
_9.gState.lineWidth=_a;
};
CGContextSetMiterLimit=function(_b,_c){
_b.gState.miterLimit=_c;
};
CGContextSetBlendMode=function(_d,_e){
_d.gState.blendMode=_e;
};
CGContextAddArc=function(_f,x,y,_10,_11,_12,_13){
CGPathAddArc(_f.path,_f.gState.CTM,x,y,_10,_11,_12,_13);
};
CGContextAddArcToPoint=function(_14,x1,y1,x2,y2,_15){
CGPathAddArcToPoint(_14.path,_14.gState.CTM,x1,y1,x2,y2,_15);
};
CGContextAddCurveToPoint=function(_16,_17,_18,_19,_1a,x,y){
CGPathAddCurveToPoint(_16.path,_16.gState.CTM,_17,_18,_19,_1a,x,y);
};
CGContextAddLines=function(_1b,_1c,_1d){
CGPathAddLines(_1b.path,_1b.gState.CTM,_1c,_1d);
};
CGContextAddLineToPoint=function(_1e,x,y){
CGPathAddLineToPoint(_1e.path,_1e.gState.CTM,x,y);
};
CGContextAddPath=function(_1f,_20){
if(!_1f||CGPathIsEmpty(_20)){
return;
}
if(!_1f.path){
_1f.path=CGPathCreateMutable();
}
CGPathAddPath(_1f.path,_1f.gState.CTM,_20);
};
CGContextAddQuadCurveToPoint=function(_21,cpx,cpy,x,y){
CGPathAddQuadCurveToPoint(_21.path,_21.gState.CTM,cpx,cpy,x,y);
};
CGContextAddRect=function(_22,_23){
CGPathAddRect(_22.path,_22.gState.CTM,_23);
};
CGContextAddRects=function(_24,_25,_26){
CGPathAddRects(_24.path,_24.gState.CTM,_25,_26);
};
CGContextBeginPath=function(_27){
_27.path=CGPathCreateMutable();
};
CGContextClosePath=function(_28){
CGPathCloseSubpath(_28.path);
};
CGContextMoveToPoint=function(_29,x,y){
if(!_29.path){
_29.path=CGPathCreateMutable();
}
CGPathMoveToPoint(_29.path,_29.gState.CTM,x,y);
};
CGContextFillRect=function(_2a,_2b){
CGContextFillRects(_2a,[_2b],1);
};
CGContextFillRects=function(_2c,_2d,_2e){
if(arguments[2]===undefined){
var _2e=_2d.length;
}
CGContextBeginPath(_2c);
CGContextAddRects(_2c,_2d,_2e);
CGContextClosePath(_2c);
CGContextDrawPath(_2c,kCGPathFill);
};
CGContextStrokeRect=function(_2f,_30){
CGContextBeginPath(_2f);
CGContextAddRect(_2f,_30);
CGContextClosePath(_2f);
CGContextDrawPath(_2f,kCGPathStroke);
};
CGContextStrokeRectWithWidth=function(_31,_32,_33){
CGContextSaveGState(_31);
CGContextSetLineWidth(_31,_33);
CGContextStrokeRect(_31,_32);
CGContextRestoreGState(_31);
};
CGContextConcatCTM=function(_34,_35){
var CTM=_34.gState.CTM;
var tx=CTM.tx*_35.a+CTM.ty*_35.c+_35.tx;
CTM.ty=CTM.tx*_35.b+CTM.ty*_35.d+_35.ty;
CTM.tx=tx;
var a=CTM.a*_35.a+CTM.b*_35.c,b=CTM.a*_35.b+CTM.b*_35.d,c=CTM.c*_35.a+CTM.d*_35.c;
CTM.d=CTM.c*_35.b+CTM.d*_35.d;
CTM.a=a;
CTM.b=b;
CTM.c=c;
};
CGContextGetCTM=function(_36){
return _36.gState.CTM;
};
CGContextRotateCTM=function(_37,_38){
var _39=_37.gState;
_39.CTM=CGAffineTransformRotate(_39.CTM,_38);
};
CGContextScaleCTM=function(_3a,sx,sy){
var _3b=_3a.gState;
_3b.CTM={a:_3b.CTM.a*sx,b:_3b.CTM.b*sx,c:_3b.CTM.c*sy,d:_3b.CTM.d*sy,tx:_3b.CTM.tx,ty:_3b.CTM.ty};
};
CGContextTranslateCTM=function(_3c,tx,ty){
var _3d=_3c.gState;
_3d.CTM={a:_3d.CTM.a,b:_3d.CTM.b,c:_3d.CTM.c,d:_3d.CTM.d,tx:_3d.CTM.tx+_3d.CTM.a*tx+_3d.CTM.c*ty,ty:_3d.CTM.ty+_3d.CTM.b*tx+_3d.CTM.d*ty};
};
CGContextSetShadow=function(_3e,_3f,_40){
var _41=_3e.gState;
_41.shadowOffset={width:_3f.width,height:_3f.height};
_41.shadowBlur=_40;
_41.shadowColor=objj_msgSend(CPColor,"shadowColor");
};
CGContextSetShadowWithColor=function(_42,_43,_44,_45){
var _46=_42.gState;
_46.shadowOffset={width:_43.width,height:_43.height};
_46.shadowBlur=_44;
_46.shadowColor=_45;
};
CGContextSetAlpha=function(_47,_48){
_47.gState.alpha=MAX(MIN(_48,1),0);
};
}
CGContextEOFillPath=function(_49){
CGContextDrawPath(_49,kCGPathEOFill);
};
CGContextFillPath=function(_4a){
CGContextDrawPath(_4a,kCGPathFill);
};
var _4b=4*((SQRT2-1)/3);
CGContextAddEllipseInRect=function(_4c,_4d){
CGContextBeginPath(_4c);
CGContextAddPath(_4c,CGPathWithEllipseInRect(_4d));
CGContextClosePath(_4c);
};
CGContextFillEllipseInRect=function(_4e,_4f){
CGContextBeginPath(_4e);
CGContextAddEllipseInRect(_4e,_4f);
CGContextClosePath(_4e);
CGContextFillPath(_4e);
};
CGContextStrokeEllipseInRect=function(_50,_51){
CGContextBeginPath(_50);
CGContextAddEllipseInRect(_50,_51);
CGContextClosePath(_50);
CGContextStrokePath(_50);
};
CGContextStrokePath=function(_52){
CGContextDrawPath(_52,kCGPathStroke);
};
CGContextStrokeLineSegments=function(_53,_54,_55){
var i=0;
if(arguments["count"]==NULL){
var _55=_54.length;
}
CGContextBeginPath(_53);
for(;i<_55;i+=2){
CGContextMoveToPoint(_53,_54[i].x,_54[i].y);
CGContextAddLineToPoint(_53,_54[i+1].x,_54[i+1].y);
}
CGContextStrokePath(_53);
};
CGContextSetFillColor=function(_56,_57){
if(_57){
_56.gState.fillStyle=objj_msgSend(_57,"cssString");
}
};
CGContextSetStrokeColor=function(_58,_59){
if(_59){
_58.gState.strokeStyle=objj_msgSend(_59,"cssString");
}
};
CGContextFillRoundedRectangleInRect=function(_5a,_5b,_5c,ne,se,sw,nw){
CGContextBeginPath(_5a);
CGContextAddPath(_5a,CGPathWithRoundedRectangleInRect(_5b,_5c,_5c,ne,se,sw,nw));
CGContextClosePath(_5a);
CGContextFillPath(_5a);
};
CGContextStrokeRoundedRectangleInRect=function(_5d,_5e,_5f,ne,se,sw,nw){
CGContextBeginPath(_5d);
CGContextAddPath(_5d,CGPathWithRoundedRectangleInRect(_5e,_5f,_5f,ne,se,sw,nw));
CGContextClosePath(_5d);
CGContextStrokePath(_5d);
};
if(CPFeatureIsCompatible(CPHTMLCanvasFeature)){
var _60=["butt","round","square"],_61=["miter","round","bevel"],_62=["source-over","source-over","source-over","source-over","darker","lighter","source-over","source-over","source-over","source-over","source-over","source-over","source-over","source-over","source-over","source-over","source-over","copy","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","xor","source-over","source-over"];
CGContextSaveGState=function(_63){
_63.save();
};
CGContextRestoreGState=function(_64){
_64.restore();
};
CGContextSetLineCap=function(_65,_66){
_65.lineCap=_60[_66];
};
CGContextSetLineJoin=function(_67,_68){
_67.lineJoin=_61[_68];
};
CGContextSetLineWidth=function(_69,_6a){
_69.lineWidth=_6a;
};
CGContextSetMiterLimit=function(_6b,_6c){
_6b.miterLimit=_6c;
};
CGContextSetBlendMode=function(_6d,_6e){
_6d.globalCompositeOperation=_62[_6e];
};
CGContextAddArc=function(_6f,x,y,_70,_71,_72,_73){
_6f.arc(x,y,_70,_71,_72,!_73);
};
CGContextAddArcToPoint=function(_74,x1,y1,x2,y2,_75){
_74.arcTo(x1,y1,x2,y2,_75);
};
CGContextAddCurveToPoint=function(_76,_77,_78,_79,_7a,x,y){
_76.bezierCurveTo(_77,_78,_79,_7a,x,y);
};
CGContextAddLineToPoint=function(_7b,x,y){
_7b.lineTo(x,y);
};
CGContextAddPath=function(_7c,_7d){
if(!_7c||CGPathIsEmpty(_7d)){
return;
}
var _7e=_7d.elements,i=0,_7f=_7d.count;
for(;i<_7f;++i){
var _80=_7e[i],_81=_80.type;
switch(_81){
case kCGPathElementMoveToPoint:
_7c.moveTo(_80.x,_80.y);
break;
case kCGPathElementAddLineToPoint:
_7c.lineTo(_80.x,_80.y);
break;
case kCGPathElementAddQuadCurveToPoint:
_7c.quadraticCurveTo(_80.cpx,_80.cpy,_80.x,_80.y);
break;
case kCGPathElementAddCurveToPoint:
_7c.bezierCurveTo(_80.cp1x,_80.cp1y,_80.cp2x,_80.cp2y,_80.x,_80.y);
break;
case kCGPathElementCloseSubpath:
_7c.closePath();
break;
case kCGPathElementAddArc:
_7c.arc(_80.x,_80.y,_80.radius,_80.startAngle,_80.endAngle,_80.clockwise);
break;
case kCGPathElementAddArcTo:
break;
}
}
};
CGContextAddRect=function(_82,_83){
_82.rect((_83.origin.x),(_83.origin.y),(_83.size.width),(_83.size.height));
};
CGContextAddRects=function(_84,_85,_86){
var i=0;
if(arguments["count"]==NULL){
var _86=_85.length;
}
for(;i<_86;++i){
var _87=_85[i];
_84.rect((_87.origin.x),(_87.origin.y),(_87.size.width),(_87.size.height));
}
};
CGContextBeginPath=function(_88){
_88.beginPath();
};
CGContextClosePath=function(_89){
_89.closePath();
};
CGContextMoveToPoint=function(_8a,x,y){
_8a.moveTo(x,y);
};
CGContextClearRect=function(_8b,_8c){
_8b.clearRect((_8c.origin.x),(_8c.origin.y),(_8c.size.width),(_8c.size.height));
};
CGContextDrawPath=function(_8d,_8e){
if(_8e==kCGPathFill||_8e==kCGPathFillStroke){
_8d.fill();
}else{
if(_8e==kCGPathEOFill||_8e==kCGPathEOFillStroke){
alert("not implemented!!!");
}
}
if(_8e==kCGPathStroke||_8e==kCGPathFillStroke||_8e==kCGPathEOFillStroke){
_8d.stroke();
}
};
CGContextFillRect=function(_8f,_90){
_8f.fillRect((_90.origin.x),(_90.origin.y),(_90.size.width),(_90.size.height));
};
CGContextFillRects=function(_91,_92,_93){
var i=0;
if(arguments["count"]==NULL){
var _93=_92.length;
}
for(;i<_93;++i){
var _94=_92[i];
_91.fillRect((_94.origin.x),(_94.origin.y),(_94.size.width),(_94.size.height));
}
};
CGContextStrokeRect=function(_95,_96){
_95.strokeRect((_96.origin.x),(_96.origin.y),(_96.size.width),(_96.size.height));
};
CGContextClip=function(_97){
_97.clip();
};
CGContextClipToRect=function(_98,_99){
_98.beginPath();
_98.rect((_99.origin.x),(_99.origin.y),(_99.size.width),(_99.size.height));
_98.closePath();
_98.clip();
};
CGContextClipToRects=function(_9a,_9b,_9c){
if(arguments["count"]==NULL){
var _9c=_9b.length;
}
_9a.beginPath();
CGContextAddRects(_9a,_9b,_9c);
_9a.clip();
};
CGContextSetAlpha=function(_9d,_9e){
_9d.globalAlpha=_9e;
};
CGContextSetFillColor=function(_9f,_a0){
_9f.fillStyle=objj_msgSend(_a0,"cssString");
};
CGContextSetStrokeColor=function(_a1,_a2){
_a1.strokeStyle=objj_msgSend(_a2,"cssString");
};
CGContextSetShadow=function(_a3,_a4,_a5){
_a3.shadowOffsetX=_a4.width;
_a3.shadowOffsetY=_a4.height;
_a3.shadowBlur=_a5;
};
CGContextSetShadowWithColor=function(_a6,_a7,_a8,_a9){
_a6.shadowOffsetX=_a7.width;
_a6.shadowOffsetY=_a7.height;
_a6.shadowBlur=_a8;
_a6.shadowColor=objj_msgSend(_a9,"cssString");
};
CGContextRotateCTM=function(_aa,_ab){
_aa.rotate(_ab);
};
CGContextScaleCTM=function(_ac,sx,sy){
_ac.scale(sx,sy);
};
CGContextTranslateCTM=function(_ad,tx,ty){
_ad.translate(tx,ty);
};
eigen=function(_ae){
alert("IMPLEMENT ME!");
};
if(CPFeatureIsCompatible(CPJavaScriptCanvasTransformFeature)){
CGContextConcatCTM=function(_af,_b0){
_af.transform(_b0.a,_b0.b,_b0.c,_b0.d,_b0.tx,_b0.ty);
};
}else{
CGContextConcatCTM=function(_b1,_b2){
var a=_b2.a,b=_b2.b,c=_b2.c,d=_b2.d,tx=_b2.tx,ty=_b2.ty,sx=1,sy=1,a1=0,a2=0;
if(b==0&&c==0){
sx=a;
sy=d;
}else{
if(a*b==-c*d){
var _b3=(a*d<0||b*c>0)?-1:1,a2=(ATAN2(b,d)+ATAN2(-_b3*c,_b3*a))/2,cos=COS(a2),sin=SIN(a2);
if(cos==0){
sx=-c/sin;
sy=b/sin;
}else{
if(sin==0){
sx=a/cos;
sy=d/cos;
}else{
abs_cos=ABS(cos);
abs_sin=ABS(sin);
sx=(abs_cos*a/cos+abs_sin*-c/sin)/(abs_cos+abs_sin);
sy=(abs_cos*d/cos+abs_sin*b/sin)/(abs_cos+abs_sin);
}
}
}else{
if(a*c==-b*d){
var _b3=(a*d<0||b*c>0)?-1:1;
a1=(Math.atan2(_b3*b,_b3*a)+Math.atan2(-c,d))/2,cos=COS(a1),sin=SIN(a1);
if(cos==0){
sx=b/sin;
sy=-c/sin;
}else{
if(sin==0){
sx=a/cos;
sy=d/cos;
}else{
abs_cos=ABS(cos);
abs_sin=ABS(sin);
sx=(abs_cos*a/cos+abs_sin*b/sin)/(abs_cos+abs_sin);
sy=(abs_cos*d/cos+abs_sin*-c/sin)/(abs_cos+abs_sin);
}
}
}else{
var _b4=CGAffineTransformMake(a,c,b,d,0,0),u=eigen(CGAffineTransformConcat(_b2,_b4)),v=eigen(CGAffineTransformConcat(_b4,_b2)),U=CGAffineTransformMake(u.vector_1.x,u.vector_2.x,u.vector_1.y,u.vector_2.y,0,0),VT=CGAffineTransformMake(v.vector_1.x,v.vector_1.y,v.vector_2.x,v.vector_2.y,0,0),S=CGAffineTransformConcat(CGAffineTransformConcat(CGAffineTransformInvert(U),_b2),CGAffineTransformInvert(VT));
a=VT.a;
b=VT.b;
c=VT.c;
d=VT.d;
var _b3=(a*d<0||b*c>0)?-1:1,a2=(ATAN2(b,d)+ATAN2(-_b3*c,_b3*a))/2,cos=COS(a2),sin=SIN(a2);
if(cos==0){
sx=-c/sin;
sy=b/sin;
}else{
if(sin==0){
sx=a/cos;
sy=d/cos;
}else{
abs_cos=ABS(cos);
abs_sin=ABS(sin);
sx=(abs_cos*a/cos+abs_sin*-c/sin)/(abs_cos+abs_sin);
sy=(abs_cos*d/cos+abs_sin*b/sin)/(abs_cos+abs_sin);
}
}
S.a*=sx;
S.d*=sy;
a=U.a;
b=U.b;
c=U.c;
d=U.d;
var _b3=(a*d<0||b*c>0)?-1:1;
a1=(Math.atan2(_b3*b,_b3*a)+Math.atan2(-c,d))/2,cos=COS(a1),sin=SIN(a1);
if(cos==0){
sx=b/sin;
sy=-c/sin;
}else{
if(sin==0){
sx=a/cos;
sy=d/cos;
}else{
abs_cos=ABS(cos);
abs_sin=ABS(sin);
sx=(abs_cos*a/cos+abs_sin*b/sin)/(abs_cos+abs_sin);
sy=(abs_cos*d/cos+abs_sin*-c/sin)/(abs_cos+abs_sin);
}
}
sx=S.a*sx;
sy=S.d*sy;
}
}
}
if(tx!=0||ty!=0){
CGContextTranslateCTM(_b1,tx,ty);
}
if(a1!=0){
CGContextRotateCTM(_b1,a1);
}
if(sx!=1||sy!=1){
CGContextScaleCTM(_b1,sx,sy);
}
if(a2!=0){
CGContextRotateCTM(_b1,a2);
}
};
}
CGContextDrawImage=function(_b5,_b6,_b7){
_b5.drawImage(_b7._image,(_b6.origin.x),(_b6.origin.y),(_b6.size.width),(_b6.size.height));
};
to_string=function(_b8){
return "rgba("+ROUND(_b8.components[0]*255)+", "+ROUND(_b8.components[1]*255)+", "+ROUND(255*_b8.components[2])+", "+_b8.components[3]+")";
};
CGContextDrawLinearGradient=function(_b9,_ba,_bb,_bc,_bd){
var _be=_ba.colors,_bf=_be.length,_c0=_b9.createLinearGradient(_bb.x,_bb.y,_bc.x,_bc.y);
while(_bf--){
_c0.addColorStop(_ba.locations[_bf],to_string(_be[_bf]));
}
_b9.fillStyle=_c0;
_b9.fill();
};
CGBitmapGraphicsContextCreate=function(){
var _c1=document.createElement("canvas"),_c2=_c1.getContext("2d");
_c2.DOMElement=_c1;
return _c2;
};
}else{
if(CPFeatureIsCompatible(CPVMLFeature)){
var _c3=["f","t"],_c4=["flat","round","square"],_c5=["miter","round","bevel"],_c6=[" m "," l ","qb"," c "," x ",[" at "," wa "]];
var _c7=CGBitmapGraphicsContextCreate;
CGBitmapGraphicsContextCreate=function(){
document.namespaces.add("cg_vml_","urn:schemas-microsoft-com:vml");
document.createStyleSheet().cssText="cg_vml_\\:*{behavior:url(#default#VML)}";
CGBitmapGraphicsContextCreate=_c7;
return _c7();
};
CGContextClearRect=function(_c8,_c9){
if(_c8.buffer!=nil){
_c8.buffer="";
}else{
_c8.DOMElement.innerHTML="";
}
_c8.path=NULL;
};
var W=10,H=10,Z=10,Z_2=Z/2;
CGContextDrawImage=function(_ca,_cb,_cc){
var _cd="";
if(_cc.buffer!=nil){
_cd=_cc.buffer;
}else{
var ctm=_ca.gState.CTM,_ce=CGPointApplyAffineTransform(_cb.origin,ctm),_cf=ctm.a==ctm.d&&ctm.b==-ctm.c,vml=["<cg_vml_:group coordsize=\"1,1\" coordorigin=\"0,0\" style=\"width:1;height:1;position:absolute"];
var _d0=CGRectApplyAffineTransform(_cb,ctm);
vml.push(";padding:0 ",ROUND((_d0.origin.x+_d0.size.width)),"px ",ROUND((_d0.origin.y+_d0.size.height)),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(","M11='",ctm.a,"',M12='",ctm.c,"',M21='",ctm.b,"',M22='",ctm.d,"',","Dx='",ROUND(_ce.x),"', Dy='",ROUND(_ce.y),"', sizingmethod='clip');");
vml.push("\"><cg_vml_:image src=\"",_cc._image.src,"\" style=\"width:",(_cb.size.width),"px;height:",(_cb.size.height),"px;\"/></g_vml_:group>");
_cd=vml.join("");
}
if(_ca.buffer!=nil){
_ca.buffer+=_cd;
}else{
_ca.DOMElement.insertAdjacentHTML("BeforeEnd",_cd);
}
};
CGContextDrawPath=function(_d1,_d2){
if(!_d1||CGPathIsEmpty(_d1.path)){
return;
}
var _d3=_d1.path.elements,i=0,_d4=_d1.path.count,_d5=_d1.gState,_d6=(_d2==kCGPathFill||_d2==kCGPathFillStroke)?1:0,_d7=(_d2==kCGPathStroke||_d2==kCGPathFillStroke)?1:0,_d8=_d5.alpha,vml=["<cg_vml_:shape"," fillcolor=\"",_d5.fillStyle,"\" filled=\"",_c3[_d6],"\" style=\"position:absolute;width:",W,";height:",H,";\" coordorigin=\"0 0\" coordsize=\"",Z*W," ",Z*H,"\" stroked=\"",_c3[_d7],"\" strokeweight=\"",_d5.lineWidth,"\" strokecolor=\"",_d5.strokeStyle,"\" path=\""];
for(;i<_d4;++i){
var _d9=_d3[i],_da=_d9.type;
switch(_da){
case kCGPathElementMoveToPoint:
case kCGPathElementAddLineToPoint:
vml.push(_c6[_da],(ROUND(Z*(_d9.x)-Z_2)),",",(ROUND(Z*(_d9.y)-Z_2)));
break;
case kCGPathElementAddQuadCurveToPoint:
vml.push(_c6[_da],(ROUND(Z*(_d9.cpx)-Z_2)),",",(ROUND(Z*(_d9.cpy)-Z_2)),",",(ROUND(Z*(_d9.x)-Z_2)),",",(ROUND(Z*(_d9.y)-Z_2)));
break;
case kCGPathElementAddCurveToPoint:
vml.push(_c6[_da],(ROUND(Z*(_d9.cp1x)-Z_2)),",",(ROUND(Z*(_d9.cp1y)-Z_2)),",",(ROUND(Z*(_d9.cp2x)-Z_2)),",",(ROUND(Z*(_d9.cp2y)-Z_2)),",",(ROUND(Z*(_d9.x)-Z_2)),",",(ROUND(Z*(_d9.y)-Z_2)));
break;
case kCGPathElementCloseSubpath:
vml.push(_c6[_da]);
break;
case kCGPathElementAddArc:
var x=_d9.x,y=_d9.y,_db=_d9.radius,_dc=_d9.clockwise?1:0,_dd=_d9.endAngle,_de=_d9.startAngle,_df={x:x+_db*COS(_de),y:y+_db*SIN(_de)};
if(_de==_dd&&!_dc){
vml.push(_c6[kCGPathElementMoveToPoint],(ROUND(Z*(_df.x)-Z_2)),",",(ROUND(Z*(_df.y)-Z_2)));
continue;
}
var end={x:x+_db*COS(_dd),y:y+_db*SIN(_dd)};
if(_dc&&_de!=_dd&&(_df.x==end.x&&_df.y==end.y)){
if(_df.x>=x){
if(_df.y<y){
_df.x+=0.125;
}else{
_df.y+=0.125;
}
}else{
if(end.y<=y){
end.x+=0.125;
}else{
end.y+=0.125;
}
}
}
vml.push(_c6[_da][_dc],(ROUND(Z*(x-_db)-Z_2)),",",(ROUND(Z*(y-_db)-Z_2))," ",(ROUND(Z*(x+_db)-Z_2)),",",(ROUND(Z*(y+_db)-Z_2))," ",(ROUND(Z*(_df.x)-Z_2)),",",(ROUND(Z*(_df.y)-Z_2))," ",(ROUND(Z*(end.x)-Z_2)),",",(ROUND(Z*(end.y)-Z_2)));
break;
case kCGPathElementAddArcTo:
break;
}
}
vml.push("\">");
if(_d5.gradient){
vml.push(_d5.gradient);
}else{
if(_d6){
vml.push("<cg_vml_:fill color=\"",_d5.fillStyle,"\" opacity=\"",_d8,"\" />");
}
}
if(_d7){
vml.push("<cg_vml_:stroke opacity=\"",_d8,"\" joinstyle=\"",_c5[_d5.lineJoin],"\" miterlimit=\"",_d5.miterLimit,"\" endcap=\"",_c4[_d5.lineCap],"\" weight=\"",_d5.lineWidth,"","px\" color=\"",_d5.strokeStyle,"\" />");
}
var _e0=_d5.shadowColor;
if(_e0){
var _e1=_d5.shadowOffset;
vml.push("<cg_vml_:shadow on=\"t\" offset=\"",_e1.width,"pt ",_e1.height,"pt\" opacity=\"",objj_msgSend(_e0,"alphaComponent"),"\" color=black />");
}
vml.push("</cg_vml_:shape>");
_d1.path=NULL;
if(_d1.buffer!=nil){
_d1.buffer+=vml.join("");
}else{
_d1.DOMElement.insertAdjacentHTML("BeforeEnd",vml.join(""));
}
};
to_string=function(_e2){
return "rgb("+ROUND(_e2.components[0]*255)+", "+ROUND(_e2.components[1]*255)+", "+ROUND(255*_e2.components[2])+")";
};
CGContextDrawLinearGradient=function(_e3,_e4,_e5,_e6,_e7){
if(!_e3||!_e4){
return;
}
var vml=nil;
if(_e4.vml_gradient){
var _e8=objj_msgSend(objj_msgSend(_e4.vml_gradient,"stops"),"sortedArrayUsingSelector:",sel_getUid("comparePosition:")),_e9=objj_msgSend(_e8,"count");
vml=["<cg_vml_:fill type=\"gradient\" method=\"linear sigma\" "];
vml.push("angle=\""+(objj_msgSend(_e4.vml_gradient,"angle")+90)+"\" ");
vml.push("colors=\"");
for(var i=0;i<_e9;i++){
vml.push((objj_msgSend(_e8[i],"position")*100).toFixed(0)+"% ");
vml.push(objj_msgSend(objj_msgSend(objj_msgSend(_e8[i],"color"),"colorForSlideBase:",nil),"cssString"));
if(i<_e9-1){
vml.push(",");
}
}
vml.push("\" />");
}else{
var _ea=_e4.colors,_e9=_ea.length;
vml=["<cg_vml_:fill type=\"gradient\" "];
vml.push("colors=\"");
for(var i=0;i<_e9;i++){
vml.push((_e4.locations[i]*100).toFixed(0)+"% "+to_string(_ea[i])+(i<_e9-1?",":""));
}
vml.push("\" />");
}
_e3.gState.gradient=vml.join("");
};
}
}
p;12;CGGeometry.jt;5891;@STATIC;1.0;t;5872;
CGPointMake=function(x,y){
return {x:x,y:y};
};
CGPointMakeZero=function(){
return {x:0,y:0};
};
CGPointMakeCopy=function(_1){
return {x:_1.x,y:_1.y};
};
CGPointCreateCopy=function(_2){
return {x:_2.x,y:_2.y};
};
CGPointEqualToPoint=function(_3,_4){
return (_3.x==_4.x&&_3.y==_4.y);
};
CGStringFromPoint=function(_5){
return ("{"+_5.x+", "+_5.y+"}");
};
CGSizeMake=function(_6,_7){
return {width:_6,height:_7};
};
CGSizeMakeZero=function(){
return {width:0,height:0};
};
CGSizeMakeCopy=function(_8){
return {width:_8.width,height:_8.height};
};
CGSizeCreateCopy=function(_9){
return {width:_9.width,height:_9.height};
};
CGSizeEqualToSize=function(_a,_b){
return (_a.width==_b.width&&_a.height==_b.height);
};
CGStringFromSize=function(_c){
return ("{"+_c.width+", "+_c.height+"}");
};
CGRectMake=function(x,y,_d,_e){
return {origin:{x:x,y:y},size:{width:_d,height:_e}};
};
CGRectMakeZero=function(){
return {origin:{x:0,y:0},size:{width:0,height:0}};
};
CGRectMakeCopy=function(_f){
return {origin:{x:_f.origin.x,y:_f.origin.y},size:{width:_f.size.width,height:_f.size.height}};
};
CGRectCreateCopy=function(_10){
return {origin:{x:_10.origin.x,y:_10.origin.y},size:{width:_10.size.width,height:_10.size.height}};
};
CGRectEqualToRect=function(_11,_12){
return ((_11.origin.x==_12.origin.x&&_11.origin.y==_12.origin.y)&&(_11.size.width==_12.size.width&&_11.size.height==_12.size.height));
};
CGStringFromRect=function(_13){
return ("{"+("{"+_13.origin.x+", "+_13.origin.y+"}")+", "+("{"+_13.size.width+", "+_13.size.height+"}")+"}");
};
CGRectOffset=function(_14,dX,dY){
return {origin:{x:_14.origin.x+dX,y:_14.origin.y+dY},size:{width:_14.size.width,height:_14.size.height}};
};
CGRectInset=function(_15,dX,dY){
return {origin:{x:_15.origin.x+dX,y:_15.origin.y+dY},size:{width:_15.size.width-2*dX,height:_15.size.height-2*dY}};
};
CGRectGetHeight=function(_16){
return (_16.size.height);
};
CGRectGetMaxX=function(_17){
return (_17.origin.x+_17.size.width);
};
CGRectGetMaxY=function(_18){
return (_18.origin.y+_18.size.height);
};
CGRectGetMidX=function(_19){
return (_19.origin.x+(_19.size.width)/2);
};
CGRectGetMidY=function(_1a){
return (_1a.origin.y+(_1a.size.height)/2);
};
CGRectGetMinX=function(_1b){
return (_1b.origin.x);
};
CGRectGetMinY=function(_1c){
return (_1c.origin.y);
};
CGRectGetWidth=function(_1d){
return (_1d.size.width);
};
CGRectIsEmpty=function(_1e){
return (_1e.size.width<=0||_1e.size.height<=0);
};
CGRectIsNull=function(_1f){
return (_1f.size.width<=0||_1f.size.height<=0);
};
CGRectContainsPoint=function(_20,_21){
return (_21.x>=(_20.origin.x)&&_21.y>=(_20.origin.y)&&_21.x<(_20.origin.x+_20.size.width)&&_21.y<(_20.origin.y+_20.size.height));
};
CGInsetMake=function(top,_22,_23,_24){
return {top:(top),right:(_22),bottom:(_23),left:(_24)};
};
CGInsetMakeZero=function(){
return {top:(0),right:(0),bottom:(0),left:(0)};
};
CGInsetMakeCopy=function(_25){
return {top:(_25.top),right:(_25.right),bottom:(_25.bottom),left:(_25.left)};
};
CGInsetIsEmpty=function(_26){
return ((_26).top===0&&(_26).right===0&&(_26).bottom===0&&(_26).left===0);
};
CGRectNull={origin:{x:Infinity,y:Infinity},size:{width:0,height:0}};
CGRectContainsRect=function(_27,_28){
var _29=CGRectUnion(_27,_28);
return ((_29.origin.x==_27.origin.x&&_29.origin.y==_27.origin.y)&&(_29.size.width==_27.size.width&&_29.size.height==_27.size.height));
};
CGRectIntersectsRect=function(_2a,_2b){
var _2c=CGRectIntersection(_2a,_2b);
return !(_2c.size.width<=0||_2c.size.height<=0);
};
CGRectIntegral=function(_2d){
_2d=CGRectStandardize(_2d);
var x=FLOOR((_2d.origin.x)),y=FLOOR((_2d.origin.y));
_2d.size.width=CEIL((_2d.origin.x+_2d.size.width))-x;
_2d.size.height=CEIL((_2d.origin.y+_2d.size.height))-y;
_2d.origin.x=x;
_2d.origin.y=y;
return _2d;
};
CGRectIntersection=function(_2e,_2f){
var _30={origin:{x:MAX((_2e.origin.x),(_2f.origin.x)),y:MAX((_2e.origin.y),(_2f.origin.y))},size:{width:0,height:0}};
_30.size.width=MIN((_2e.origin.x+_2e.size.width),(_2f.origin.x+_2f.size.width))-(_30.origin.x);
_30.size.height=MIN((_2e.origin.y+_2e.size.height),(_2f.origin.y+_2f.size.height))-(_30.origin.y);
return (_30.size.width<=0||_30.size.height<=0)?{origin:{x:0,y:0},size:{width:0,height:0}}:_30;
};
CGRectStandardize=function(_31){
var _32=(_31.size.width),_33=(_31.size.height),_34={origin:{x:_31.origin.x,y:_31.origin.y},size:{width:_31.size.width,height:_31.size.height}};
if(_32<0){
_34.origin.x+=_32;
_34.size.width=-_32;
}
if(_33<0){
_34.origin.y+=_33;
_34.size.height=-_33;
}
return _34;
};
CGRectUnion=function(_35,_36){
var _37=!_35||_35===CGRectNull,_38=!_36||_36===CGRectNull;
if(_37){
return _38?CGRectNull:_36;
}
if(_38){
return _37?CGRectNull:_35;
}
var _39=MIN((_35.origin.x),(_36.origin.x)),_3a=MIN((_35.origin.y),(_36.origin.y)),_3b=MAX((_35.origin.x+_35.size.width),(_36.origin.x+_36.size.width)),_3c=MAX((_35.origin.y+_35.size.height),(_36.origin.y+_36.size.height));
return {origin:{x:_39,y:_3a},size:{width:_3b-_39,height:_3c-_3a}};
};
CGPointFromString=function(_3d){
var _3e=_3d.indexOf(",");
return {x:parseInt(_3d.substr(1,_3e-1)),y:parseInt(_3d.substring(_3e+1,_3d.length))};
};
CGSizeFromString=function(_3f){
var _40=_3f.indexOf(",");
return {width:parseInt(_3f.substr(1,_40-1)),height:parseInt(_3f.substring(_40+1,_3f.length))};
};
CGRectFromString=function(_41){
var _42=_41.indexOf(",",_41.indexOf(",")+1);
return {origin:CGPointFromString(_41.substr(1,_42-1)),size:CGSizeFromString(_41.substring(_42+2,_41.length))};
};
CGPointFromEvent=function(_43){
return {x:_43.clientX,y:_43.clientY};
};
CGInsetFromString=function(_44){
var _45=_44.substr(1,_44.length-2).split(",");
return {top:(parseFloat(_45[0])),right:(parseFloat(_45[1])),bottom:(parseFloat(_45[2])),left:(parseFloat(_45[3]))};
};
CGInsetFromCPString=CGInsetFromString;
CPStringFromCGInset=function(_46){
return "{"+_46.top+", "+_46.left+", "+_46.bottom+", "+_46.right+"}";
};
p;12;CGGradient.jt;622;@STATIC;1.0;i;9;CGColor.ji;14;CGColorSpace.jt;572;
objj_executeFile("CGColor.j",YES);
objj_executeFile("CGColorSpace.j",YES);
kCGGradientDrawsBeforeStartLocation=1<<0;
kCGGradientDrawsAfterEndLocation=1<<1;
CGGradientCreateWithColorComponents=function(_1,_2,_3,_4){
if(arguments["count"]==NULL){
var _4=_3.length;
}
var _5=[];
while(_4--){
var _6=_4*4;
_5[_4]=CGColorCreate(_1,_2.slice(_6,_6+4));
}
return CGGradientCreateWithColors(_1,_5,_3);
};
CGGradientCreateWithColors=function(_7,_8,_9){
return {colorspace:_7,colors:_8,locations:_9};
};
CGGradientRelease=function(){
};
CGGradientRetain=function(_a){
return _a;
};
p;8;CGPath.jt;7466;@STATIC;1.0;i;12;CGGeometry.ji;19;CGAffineTransform.jt;7406;
objj_executeFile("CGGeometry.j",YES);
objj_executeFile("CGAffineTransform.j",YES);
kCGPathElementMoveToPoint=0;
kCGPathElementAddLineToPoint=1;
kCGPathElementAddQuadCurveToPoint=2;
kCGPathElementAddCurveToPoint=3;
kCGPathElementCloseSubpath=4;
kCGPathElementAddArc=5;
kCGPathElementAddArcToPoint=6;
CGPathCreateMutable=function(){
return {count:0,start:NULL,current:NULL,elements:[]};
};
CGPathCreateMutableCopy=function(_1){
var _2=CGPathCreateMutable();
CGPathAddPath(_2,_1);
return _2;
};
CGPathCreateCopy=function(_3){
return CGPathCreateMutableCopy(_3);
};
CGPathRelease=function(_4){
};
CGPathRetain=function(_5){
return _5;
};
CGPathAddArc=function(_6,_7,x,y,_8,_9,_a,_b){
if(_7&&!(_7.a==1&&_7.b==0&&_7.c==0&&_7.d==1&&_7.tx==0&&_7.ty==0)){
var _c={x:x,y:y},_d={x:COS(_a),y:SIN(_a)},_e={x:COS(_9),y:SIN(_9)};
_d={x:_d.x*_7.a+_d.y*_7.c+_7.tx,y:_d.x*_7.b+_d.y*_7.d+_7.ty};
_e={x:_e.x*_7.a+_e.y*_7.c+_7.tx,y:_e.x*_7.b+_e.y*_7.d+_7.ty};
_c={x:_c.x*_7.a+_c.y*_7.c+_7.tx,y:_c.x*_7.b+_c.y*_7.d+_7.ty};
x=_c.x;
y=_c.y;
var _f=_a,_10=_9;
_a=ATAN2(_d.y-_7.ty,_d.x-_7.tx);
_9=ATAN2(_e.y-_7.ty,_e.x-_7.tx);
if(_a==_9&&_f!=_10){
if(_10>_f){
_a=_a-PI2;
}else{
_9=_9-PI2;
}
}
_8={width:_8,height:0};
_8={width:_8.width*_7.a+_8.height*_7.c,height:_8.width*_7.b+_8.height*_7.d};
_8=SQRT(_8.width*_8.width+_8.height*_8.height);
}
_6.current={x:x+_8*COS(_a),y:y+_8*SIN(_a)};
_6.elements[_6.count++]={type:kCGPathElementAddArc,x:x,y:y,radius:_8,startAngle:_9,endAngle:_a};
};
CGPathAddArcToPoint=function(_11,_12,x1,y1,x2,y2,_13){
};
CGPathAddCurveToPoint=function(_14,_15,_16,_17,_18,_19,x,y){
var cp1={x:_16,y:_17},cp2={x:_18,y:_19},end={x:x,y:y};
if(_15){
cp1={x:cp1.x*_15.a+cp1.y*_15.c+_15.tx,y:cp1.x*_15.b+cp1.y*_15.d+_15.ty};
cp2={x:cp2.x*_15.a+cp2.y*_15.c+_15.tx,y:cp2.x*_15.b+cp2.y*_15.d+_15.ty};
end={x:end.x*_15.a+end.y*_15.c+_15.tx,y:end.x*_15.b+end.y*_15.d+_15.ty};
}
_14.current=end;
_14.elements[_14.count++]={type:kCGPathElementAddCurveToPoint,cp1x:cp1.x,cp1y:cp1.y,cp2x:cp2.x,cp2y:cp2.y,x:end.x,y:end.y};
};
CGPathAddLines=function(_1a,_1b,_1c,_1d){
var i=1;
if(arguments["count"]==NULL){
var _1d=_1c.length;
}
if(!_1a||_1d<2){
return;
}
CGPathMoveToPoint(_1a,_1b,_1c[0].x,_1c[0].y);
for(;i<_1d;++i){
CGPathAddLineToPoint(_1a,_1b,_1c[i].x,_1c[i].y);
}
};
CGPathAddLineToPoint=function(_1e,_1f,x,y){
var _20={x:x,y:y};
if(_1f!=NULL){
_20={x:_20.x*_1f.a+_20.y*_1f.c+_1f.tx,y:_20.x*_1f.b+_20.y*_1f.d+_1f.ty};
}
_1e.elements[_1e.count++]={type:kCGPathElementAddLineToPoint,x:_20.x,y:_20.y};
_1e.current=_20;
};
CGPathAddPath=function(_21,_22,_23){
for(var i=0,_24=_23.count;i<_24;++i){
var _25=_23.elements[i];
switch(_25.type){
case kCGPathElementAddLineToPoint:
CGPathAddLineToPoint(_21,_22,_25.x,_25.y);
break;
case kCGPathElementAddCurveToPoint:
CGPathAddCurveToPoint(_21,_22,_25.cp1x,_25.cp1y,_25.cp2x,_25.cp2y,_25.x,_25.y);
break;
case kCGPathElementAddArc:
CGPathAddArc(_21,_22,_25.x,_25.y,_25.radius,_25.startAngle,_25.endAngle,_25.isClockwise);
break;
case kCGPathElementAddQuadCurveToPoint:
CGPathAddQuadCurveToPoint(_21,_22,_25.cpx,_25.cpy,_25.x,_25.y);
break;
case kCGPathElementMoveToPoint:
CGPathMoveToPoint(_21,_22,_25.x,_25.y);
break;
case kCGPathElementCloseSubpath:
CGPathCloseSubpath(_21);
break;
}
}
};
CGPathAddQuadCurveToPoint=function(_26,_27,cpx,cpy,x,y){
var cp={x:cpx,y:cpy},end={x:x,y:y};
if(_27){
cp={x:cp.x*_27.a+cp.y*_27.c+_27.tx,y:cp.x*_27.b+cp.y*_27.d+_27.ty};
end={x:end.x*_27.a+end.y*_27.c+_27.tx,y:end.x*_27.b+end.y*_27.d+_27.ty};
}
_26.elements[_26.count++]={type:kCGPathElementAddQuadCurveToPoint,cpx:cp.x,cpy:cp.y,x:end.x,y:end.y};
_26.current=end;
};
CGPathAddRect=function(_28,_29,_2a){
CGPathAddRects(_28,_29,[_2a],1);
};
CGPathAddRects=function(_2b,_2c,_2d,_2e){
var i=0;
if(arguments["count"]==NULL){
var _2e=_2d.length;
}
for(;i<_2e;++i){
var _2f=_2d[i];
CGPathMoveToPoint(_2b,_2c,(_2f.origin.x),(_2f.origin.y));
CGPathAddLineToPoint(_2b,_2c,(_2f.origin.x+_2f.size.width),(_2f.origin.y));
CGPathAddLineToPoint(_2b,_2c,(_2f.origin.x+_2f.size.width),(_2f.origin.y+_2f.size.height));
CGPathAddLineToPoint(_2b,_2c,(_2f.origin.x),(_2f.origin.y+_2f.size.height));
CGPathCloseSubpath(_2b);
}
};
CGPathMoveToPoint=function(_30,_31,x,y){
var _32={x:x,y:y},_33=_30.count;
if(_31!=NULL){
_32={x:_32.x*_31.a+_32.y*_31.c+_31.tx,y:_32.x*_31.b+_32.y*_31.d+_31.ty};
}
_30.start=_32;
_30.current=_32;
var _34=_30.elements[_33-1];
if(_33!=0&&_34.type==kCGPathElementMoveToPoint){
_34.x=_32.x;
_34.y=_32.y;
}else{
_30.elements[_30.count++]={type:kCGPathElementMoveToPoint,x:_32.x,y:_32.y};
}
};
var _35=4*((SQRT2-1)/3);
CGPathWithEllipseInRect=function(_36){
var _37=CGPathCreateMutable();
if((_36.size.width)==(_36.size.height)){
CGPathAddArc(_37,nil,(_36.origin.x+(_36.size.width)/2),(_36.origin.y+(_36.size.height)/2),(_36.size.width)/2,0,2*PI,YES);
}else{
var _38={width:(_36.size.width)/2,height:(_36.size.height)/2},_39={x:(_36.origin.x)+_38.width,y:(_36.origin.y)+_38.height};
CGPathMoveToPoint(_37,nil,_39.x,_39.y-_38.height);
CGPathAddCurveToPoint(_37,nil,_39.x+(_35*_38.width),_39.y-_38.height,_39.x+_38.width,_39.y-(_35*_38.height),_39.x+_38.width,_39.y);
CGPathAddCurveToPoint(_37,nil,_39.x+_38.width,_39.y+(_35*_38.height),_39.x+(_35*_38.width),_39.y+_38.height,_39.x,_39.y+_38.height);
CGPathAddCurveToPoint(_37,nil,_39.x-(_35*_38.width),_39.y+_38.height,_39.x-_38.width,_39.y+(_35*_38.height),_39.x-_38.width,_39.y);
CGPathAddCurveToPoint(_37,nil,_39.x-_38.width,_39.y-(_35*_38.height),_39.x-(_35*_38.width),_39.y-_38.height,_39.x,_39.y-_38.height);
}
CGPathCloseSubpath(_37);
return _37;
};
CGPathWithRoundedRectangleInRect=function(_3a,_3b,_3c,ne,se,sw,nw){
var _3d=CGPathCreateMutable(),_3e=(_3a.origin.x),_3f=(_3a.origin.x+_3a.size.width),_40=(_3a.origin.y),_41=(_3a.origin.y+_3a.size.height);
CGPathMoveToPoint(_3d,nil,_3e+_3b,_40);
if(ne){
CGPathAddLineToPoint(_3d,nil,_3f-_3b,_40);
CGPathAddCurveToPoint(_3d,nil,_3f-_3b,_40,_3f,_40,_3f,_40+_3b);
}else{
CGPathAddLineToPoint(_3d,nil,_3f,_40);
}
if(se){
CGPathAddLineToPoint(_3d,nil,_3f,_41-_3b);
CGPathAddCurveToPoint(_3d,nil,_3f,_41-_3b,_3f,_41,_3f-_3b,_41);
}else{
CGPathAddLineToPoint(_3d,nil,_3f,_41);
}
if(sw){
CGPathAddLineToPoint(_3d,nil,_3e+_3b,_41);
CGPathAddCurveToPoint(_3d,nil,_3e+_3b,_41,_3e,_41,_3e,_41-_3b);
}else{
CGPathAddLineToPoint(_3d,nil,_3e,_41);
}
if(nw){
CGPathAddLineToPoint(_3d,nil,_3e,_40+_3b);
CGPathAddCurveToPoint(_3d,nil,_3e,_40+_3b,_3e,_40,_3e+_3b,_40);
}else{
CGPathAddLineToPoint(_3d,nil,_3e,_40);
}
CGPathCloseSubpath(_3d);
return _3d;
};
CGPathCloseSubpath=function(_42){
var _43=_42.count;
if(_43==0||_42.elements[_43-1].type==kCGPathElementCloseSubpath){
return;
}
_42.elements[_42.count++]={type:kCGPathElementCloseSubpath,points:[_42.start]};
};
CGPathEqualToPath=function(_44,_45){
if(_44==_45){
return YES;
}
if(_44.count!=_45.count||!(_44.start.x==_45.start.x&&_44.start.y==_45.start.y)||!(_44.current.x==_45.current.x&&_44.current.y==_45.current.y)){
return NO;
}
var i=0,_46=_44.count;
for(;i<_46;++i){
var _47=_44[i],_48=_45[i];
if(_47.type!=_48.type){
return NO;
}
if((_47.type==kCGPathElementAddArc||_47.type==kCGPathElementAddArcToPoint)&&_47.radius!=_48.radius){
return NO;
}
var j=_47.points.length;
while(j--){
if(!(_47.points[j].x==_48.points[j].x&&_47.points[j].y==_48.points[j].y)){
return NO;
}
}
}
return YES;
};
CGPathGetCurrentPoint=function(_49){
return {x:_49.current.x,y:_49.current.y};
};
CGPathIsEmpty=function(_4a){
return !_4a||_4a.count==0;
};
p;18;_CPMenuBarWindow.jt;13231;@STATIC;1.0;i;15;_CPMenuWindow.jt;13191;
objj_executeFile("_CPMenuWindow.j",YES);
var _1=28,_2=10,_3=10,_4=10;
var _5=nil,_6=nil;
var _7=objj_allocateClassPair(CPPanel,"_CPMenuBarWindow"),_8=_7.isa;
class_addIvars(_7,[new objj_ivar("_menu"),new objj_ivar("_highlightView"),new objj_ivar("_menuItemViews"),new objj_ivar("_trackingMenuItem"),new objj_ivar("_iconImageView"),new objj_ivar("_titleField"),new objj_ivar("_textColor"),new objj_ivar("_titleColor"),new objj_ivar("_textShadowColor"),new objj_ivar("_titleShadowColor"),new objj_ivar("_highlightColor"),new objj_ivar("_highlightTextColor"),new objj_ivar("_highlightTextShadowColor")]);
objj_registerClassPair(_7);
class_addMethods(_7,[new objj_method(sel_getUid("init"),function(_9,_a){
with(_9){
var _b=objj_msgSend(objj_msgSend(CPPlatformWindow,"primaryPlatformWindow"),"contentBounds");
_b.size.height=_1;
_9=objj_msgSendSuper({receiver:_9,super_class:objj_getClass("_CPMenuBarWindow").super_class},"initWithContentRect:styleMask:",_b,CPBorderlessWindowMask);
if(_9){
objj_msgSend(_9,"setLevel:",CPMainMenuWindowLevel);
objj_msgSend(_9,"setAutoresizingMask:",CPWindowWidthSizable);
var _c=objj_msgSend(_9,"contentView");
objj_msgSend(_c,"setAutoresizesSubviews:",NO);
objj_msgSend(_9,"setBecomesKeyOnlyIfNeeded:",YES);
_iconImageView=objj_msgSend(objj_msgSend(CPImageView,"alloc"),"initWithFrame:",CGRectMake(0,0,16,16));
objj_msgSend(_c,"addSubview:",_iconImageView);
_titleField=objj_msgSend(objj_msgSend(CPTextField,"alloc"),"initWithFrame:",CGRectMakeZero());
objj_msgSend(_titleField,"setFont:",objj_msgSend(CPFont,"boldSystemFontOfSize:",13));
objj_msgSend(_titleField,"setAlignment:",CPCenterTextAlignment);
objj_msgSend(_titleField,"setTextShadowOffset:",CGSizeMake(0,1));
objj_msgSend(_c,"addSubview:",_titleField);
}
return _9;
}
}),new objj_method(sel_getUid("setTitle:"),function(_d,_e,_f){
with(_d){
var _10=objj_msgSend(objj_msgSend(CPBundle,"mainBundle"),"objectForInfoDictionaryKey:","CPBundleName");
if(!objj_msgSend(_10,"length")){
document.title=_f;
}else{
if(objj_msgSend(_f,"length")){
document.title=_f+" - "+_10;
}else{
document.title=_10;
}
}
objj_msgSend(_titleField,"setStringValue:",_f);
objj_msgSend(_titleField,"sizeToFit");
objj_msgSend(_d,"tile");
}
}),new objj_method(sel_getUid("setIconImage:"),function(_11,_12,_13){
with(_11){
objj_msgSend(_iconImageView,"setImage:",_13);
objj_msgSend(_iconImageView,"setHidden:",_13==nil);
objj_msgSend(_11,"tile");
}
}),new objj_method(sel_getUid("setIconImageAlphaValue:"),function(_14,_15,_16){
with(_14){
objj_msgSend(_iconImageView,"setAlphaValue:",_16);
}
}),new objj_method(sel_getUid("setColor:"),function(_17,_18,_19){
with(_17){
if(!_19){
if(!_5){
_5=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(_CPMenuBarWindow,"class")),"pathForResource:","_CPMenuBarWindow/_CPMenuBarWindowBackground.png"),CGSizeMake(1,28)));
}
objj_msgSend(objj_msgSend(_17,"contentView"),"setBackgroundColor:",_5);
}else{
objj_msgSend(objj_msgSend(_17,"contentView"),"setBackgroundColor:",_19);
}
}
}),new objj_method(sel_getUid("setTextColor:"),function(_1a,_1b,_1c){
with(_1a){
if(_textColor==_1c){
return;
}
_textColor=_1c;
objj_msgSend(_menuItemViews,"makeObjectsPerformSelector:withObject:",sel_getUid("setTextColor:"),_textColor);
}
}),new objj_method(sel_getUid("setTitleColor:"),function(_1d,_1e,_1f){
with(_1d){
if(_titleColor==_1f){
return;
}
_titleColor=_1f;
objj_msgSend(_titleField,"setTextColor:",_1f?_1f:objj_msgSend(CPColor,"blackColor"));
}
}),new objj_method(sel_getUid("setTextShadowColor:"),function(_20,_21,_22){
with(_20){
if(_textShadowColor==_22){
return;
}
_textShadowColor=_22;
objj_msgSend(_menuItemViews,"makeObjectsPerformSelector:withObject:",sel_getUid("setTextShadowColor:"),_textShadowColor);
}
}),new objj_method(sel_getUid("setTitleShadowColor:"),function(_23,_24,_25){
with(_23){
if(_titleShadowColor==_25){
return;
}
_titleShadowColor=_25;
objj_msgSend(_titleField,"setTextShadowColor:",_25?_25:objj_msgSend(CPColor,"whiteColor"));
}
}),new objj_method(sel_getUid("setHighlightColor:"),function(_26,_27,_28){
with(_26){
if(_highlightColor==_28){
return;
}
_highlightColor=_28;
}
}),new objj_method(sel_getUid("setHighlightTextColor:"),function(_29,_2a,_2b){
with(_29){
if(_highlightTextColor==_2b){
return;
}
_highlightTextColor=_2b;
}
}),new objj_method(sel_getUid("setHighlightTextShadowColor:"),function(_2c,_2d,_2e){
with(_2c){
if(_highlightTextShadowColor==_2e){
return;
}
_highlightTextShadowColor=_2e;
}
}),new objj_method(sel_getUid("setMenu:"),function(_2f,_30,_31){
with(_2f){
if(_menu==_31){
return;
}
var _32=objj_msgSend(CPNotificationCenter,"defaultCenter");
if(_menu){
objj_msgSend(_32,"removeObserver:name:object:",_2f,CPMenuDidAddItemNotification,_menu);
objj_msgSend(_32,"removeObserver:name:object:",_2f,CPMenuDidChangeItemNotification,_menu);
objj_msgSend(_32,"removeObserver:name:object:",_2f,CPMenuDidRemoveItemNotification,_menu);
var _33=objj_msgSend(_menu,"itemArray"),_34=_33.length;
while(_34--){
objj_msgSend(objj_msgSend(_33[_34],"_menuItemView"),"removeFromSuperview");
}
}
_menu=_31;
if(_menu){
objj_msgSend(_32,"addObserver:selector:name:object:",_2f,sel_getUid("menuDidAddItem:"),CPMenuDidAddItemNotification,_menu);
objj_msgSend(_32,"addObserver:selector:name:object:",_2f,sel_getUid("menuDidChangeItem:"),CPMenuDidChangeItemNotification,_menu);
objj_msgSend(_32,"addObserver:selector:name:object:",_2f,sel_getUid("menuDidRemoveItem:"),CPMenuDidRemoveItemNotification,_menu);
}
_menuItemViews=[];
var _35=objj_msgSend(_2f,"contentView"),_33=objj_msgSend(_menu,"itemArray"),_34=_33.length;
for(index=0;index<_34;++index){
var _36=_33[index],_37=objj_msgSend(_36,"_menuItemView");
_menuItemViews.push(_37);
objj_msgSend(_37,"setTextColor:",_textColor);
objj_msgSend(_37,"setHidden:",objj_msgSend(_36,"isHidden"));
objj_msgSend(_37,"synchronizeWithMenuItem");
objj_msgSend(_35,"addSubview:",_37);
}
objj_msgSend(_2f,"tile");
}
}),new objj_method(sel_getUid("menuDidChangeItem:"),function(_38,_39,_3a){
with(_38){
var _3b=objj_msgSend(_menu,"itemAtIndex:",objj_msgSend(objj_msgSend(_3a,"userInfo"),"objectForKey:","CPMenuItemIndex")),_3c=objj_msgSend(_3b,"_menuItemView");
objj_msgSend(_3c,"setHidden:",objj_msgSend(_3b,"isHidden"));
objj_msgSend(_3c,"synchronizeWithMenuItem");
objj_msgSend(_38,"tile");
}
}),new objj_method(sel_getUid("menuDidAddItem:"),function(_3d,_3e,_3f){
with(_3d){
var _40=objj_msgSend(objj_msgSend(_3f,"userInfo"),"objectForKey:","CPMenuItemIndex"),_41=objj_msgSend(_menu,"itemAtIndex:",_40),_42=objj_msgSend(_41,"_menuItemView");
objj_msgSend(_menuItemViews,"insertObject:atIndex:",_42,_40);
objj_msgSend(_42,"setTextColor:",_textColor);
objj_msgSend(_42,"setHidden:",objj_msgSend(_41,"isHidden"));
objj_msgSend(_42,"synchronizeWithMenuItem");
objj_msgSend(objj_msgSend(_3d,"contentView"),"addSubview:",_42);
objj_msgSend(_3d,"tile");
}
}),new objj_method(sel_getUid("menuDidRemoveItem:"),function(_43,_44,_45){
with(_43){
var _46=objj_msgSend(objj_msgSend(_45,"userInfo"),"objectForKey:","CPMenuItemIndex"),_47=objj_msgSend(_menuItemViews,"objectAtIndex:",_46);
objj_msgSend(_menuItemViews,"removeObjectAtIndex:",_46);
objj_msgSend(_47,"removeFromSuperview");
objj_msgSend(_43,"tile");
}
}),new objj_method(sel_getUid("mouseDown:"),function(_48,_49,_4a){
with(_48){
var _4b=CGRectInset(objj_msgSend(objj_msgSend(_48,"platformWindow"),"visibleFrame"),5,0);
_4b.size.height-=5;
objj_msgSend(objj_msgSend(_CPMenuManager,"sharedMenuManager"),"beginTracking:menuContainer:constraintRect:callback:",_4a,_48,_4b,function(_4c,_4d){
objj_msgSend(_4d,"_performActionOfHighlightedItemChain");
objj_msgSend(_4d,"_highlightItemAtIndex:",CPNotFound);
});
}
}),new objj_method(sel_getUid("font"),function(_4e,_4f){
with(_4e){
objj_msgSend(CPFont,"systemFontOfSize:",12);
}
}),new objj_method(sel_getUid("tile"),function(_50,_51){
with(_50){
var _52=objj_msgSend(_menu,"itemArray"),_53=0,_54=_52.length,x=_3,y=0,_55=YES;
for(;_53<_54;++_53){
var _56=_52[_53];
if(objj_msgSend(_56,"isSeparatorItem")){
x=CGRectGetWidth(objj_msgSend(_50,"frame"))-_4;
_55=NO;
continue;
}
if(objj_msgSend(_56,"isHidden")){
continue;
}
var _57=objj_msgSend(_56,"_menuItemView"),_58=objj_msgSend(_57,"frame");
if(_55){
objj_msgSend(_57,"setFrame:",CGRectMake(x,0,CGRectGetWidth(_58),_1));
x+=CGRectGetWidth(objj_msgSend(_57,"frame"));
}else{
objj_msgSend(_57,"setFrame:",CGRectMake(x-CGRectGetWidth(_58),0,CGRectGetWidth(_58),_1));
x=CGRectGetMinX(objj_msgSend(_57,"frame"));
}
}
var _59=objj_msgSend(objj_msgSend(_50,"contentView"),"bounds"),_5a=objj_msgSend(_titleField,"frame");
if(objj_msgSend(_iconImageView,"isHidden")){
objj_msgSend(_titleField,"setFrameOrigin:",CGPointMake((CGRectGetWidth(_59)-CGRectGetWidth(_5a))/2,(CGRectGetHeight(_59)-CGRectGetHeight(_5a))/2));
}else{
var _5b=objj_msgSend(_iconImageView,"frame"),_5c=CGRectGetWidth(_5b),_5d=_5c+CGRectGetWidth(_5a);
objj_msgSend(_iconImageView,"setFrameOrigin:",CGPointMake((CGRectGetWidth(_59)-_5d)/2,(CGRectGetHeight(_59)-CGRectGetHeight(_5b))/2));
objj_msgSend(_titleField,"setFrameOrigin:",CGPointMake((CGRectGetWidth(_59)-_5d)/2+_5c,(CGRectGetHeight(_59)-CGRectGetHeight(_5a))/2));
}
}
}),new objj_method(sel_getUid("setFrame:display:animate:"),function(_5e,_5f,_60,_61,_62){
with(_5e){
var _63=objj_msgSend(_5e,"frame").size;
objj_msgSendSuper({receiver:_5e,super_class:objj_getClass("_CPMenuBarWindow").super_class},"setFrame:display:animate:",_60,_61,_62);
if(!(_63.width==_60.size.width&&_63.height==_60.size.height)){
objj_msgSend(_5e,"tile");
}
}
})]);
class_addMethods(_8,[new objj_method(sel_getUid("initialize"),function(_64,_65){
with(_64){
if(_64!=objj_msgSend(_CPMenuBarWindow,"class")){
return;
}
var _66=objj_msgSend(CPBundle,"bundleForClass:",_64);
_6=objj_msgSend(CPFont,"boldSystemFontOfSize:",12);
}
}),new objj_method(sel_getUid("font"),function(_67,_68){
with(_67){
return _6;
}
})]);
var _7=objj_getClass("_CPMenuBarWindow");
if(!_7){
throw new SyntaxError("*** Could not find definition for class \"_CPMenuBarWindow\"");
}
var _8=_7.isa;
class_addMethods(_7,[new objj_method(sel_getUid("isMenuBar"),function(_69,_6a){
with(_69){
return YES;
}
}),new objj_method(sel_getUid("globalFrame"),function(_6b,_6c){
with(_6b){
return objj_msgSend(_6b,"frame");
}
}),new objj_method(sel_getUid("scrollingStateForPoint:"),function(_6d,_6e,_6f){
with(_6d){
return _CPMenuManagerScrollingStateNone;
}
}),new objj_method(sel_getUid("itemIndexAtPoint:"),function(_70,_71,_72){
with(_70){
var _73=objj_msgSend(_menu,"itemArray"),_74=_73.length;
while(_74--){
var _75=_73[_74];
if(objj_msgSend(_75,"isHidden")||objj_msgSend(_75,"isSeparatorItem")){
continue;
}
if(CGRectContainsPoint(objj_msgSend(_70,"rectForItemAtIndex:",_74),_72)){
return _74;
}
}
return CPNotFound;
}
}),new objj_method(sel_getUid("rectForItemAtIndex:"),function(_76,_77,_78){
with(_76){
var _79=objj_msgSend(_menu,"itemAtIndex:",_78===CPNotFound?0:_78);
return objj_msgSend(objj_msgSend(_79,"_menuItemView"),"frame");
}
})]);
var _7=objj_allocateClassPair(_CPMenuView,"_CPMenuBarView"),_8=_7.isa;
objj_registerClassPair(_7);
class_addMethods(_7,[new objj_method(sel_getUid("rectForItemAtIndex:"),function(_7a,_7b,_7c){
with(_7a){
return objj_msgSend(_menuItemViews[_7c===CPNotFound?0:_7c],"frame");
}
}),new objj_method(sel_getUid("itemIndexAtPoint:"),function(_7d,_7e,_7f){
with(_7d){
var _80=objj_msgSend(_7d,"bounds");
if(!CGRectContainsPoint(_80,_7f)){
return CPNotFound;
}
var x=_7f.x,low=0,_81=_visibleMenuItemInfos.length-1;
while(low<=_81){
var _82=FLOOR(low+(_81-low)/2),_83=_visibleMenuItemInfos[_82],_84=objj_msgSend(_83.view,"frame");
if(x<CGRectGetMinX(_84)){
_81=_82-1;
}else{
if(x>CGRectGetMaxX(_84)){
low=_82+1;
}else{
return _83.index;
}
}
}
return CPNotFound;
}
}),new objj_method(sel_getUid("tile"),function(_85,_86){
with(_85){
var _87=objj_msgSend(_menu,"itemArray"),_88=0,_89=_87.length,x=_3,y=0,_8a=YES;
for(;_88<_89;++_88){
var _8b=_87[_88];
if(objj_msgSend(_8b,"isSeparatorItem")){
x=CGRectGetWidth(objj_msgSend(_85,"frame"))-_4;
_8a=NO;
continue;
}
if(objj_msgSend(_8b,"isHidden")){
continue;
}
var _8c=objj_msgSend(_8b,"_menuItemView"),_8d=objj_msgSend(_8c,"frame");
if(_8a){
objj_msgSend(_8c,"setFrameOrigin:",CGPointMake(x,(_1-1-CGRectGetHeight(_8d))/2));
x+=CGRectGetWidth(objj_msgSend(_8c,"frame"))+_2;
}else{
objj_msgSend(_8c,"setFrameOrigin:",CGPointMake(x-CGRectGetWidth(_8d),(_1-1-CGRectGetHeight(_8d))/2));
x=CGRectGetMinX(objj_msgSend(_8c,"frame"))-_2;
}
}
var _8e=objj_msgSend(objj_msgSend(_85,"contentView"),"bounds"),_8f=objj_msgSend(_titleField,"frame");
if(objj_msgSend(_iconImageView,"isHidden")){
objj_msgSend(_titleField,"setFrameOrigin:",CGPointMake((CGRectGetWidth(_8e)-CGRectGetWidth(_8f))/2,(CGRectGetHeight(_8e)-CGRectGetHeight(_8f))/2));
}else{
var _90=objj_msgSend(_iconImageView,"frame"),_91=CGRectGetWidth(_90),_92=_91+CGRectGetWidth(_8f);
objj_msgSend(_iconImageView,"setFrameOrigin:",CGPointMake((CGRectGetWidth(_8e)-_92)/2,(CGRectGetHeight(_8e)-CGRectGetHeight(_90))/2));
objj_msgSend(_titleField,"setFrameOrigin:",CGPointMake((CGRectGetWidth(_8e)-_92)/2+_91,(CGRectGetHeight(_8e)-CGRectGetHeight(_8f))/2));
}
}
})]);
p;16;_CPMenuManager.jt;8469;@STATIC;1.0;I;21;Foundation/CPObject.jt;8424;
objj_executeFile("Foundation/CPObject.j",NO);
_CPMenuManagerScrollingStateUp=-1,_CPMenuManagerScrollingStateDown=1,_CPMenuManagerScrollingStateNone=0;
var _1=500;
var _2=nil;
var _3=objj_allocateClassPair(CPObject,"_CPMenuManager"),_4=_3.isa;
class_addIvars(_3,[new objj_ivar("_startTime"),new objj_ivar("_scrollingState"),new objj_ivar("_lastGlobalLocation"),new objj_ivar("_lastMouseOverMenuView"),new objj_ivar("_constraintRect"),new objj_ivar("_menuContainerStack"),new objj_ivar("_trackingCallback")]);
objj_registerClassPair(_3);
class_addMethods(_3,[new objj_method(sel_getUid("init"),function(_5,_6){
with(_5){
if(_2){
return _2;
}
return objj_msgSendSuper({receiver:_5,super_class:objj_getClass("_CPMenuManager").super_class},"init");
}
}),new objj_method(sel_getUid("trackingMenuContainer"),function(_7,_8){
with(_7){
return _menuContainerStack[0];
}
}),new objj_method(sel_getUid("trackingMenu"),function(_9,_a){
with(_9){
return objj_msgSend(objj_msgSend(_9,"trackingMenuContainer"),"menu");
}
}),new objj_method(sel_getUid("beginTracking:menuContainer:constraintRect:callback:"),function(_b,_c,_d,_e,_f,_10){
with(_b){
var _11=objj_msgSend(_e,"menu");
CPApp._activeMenu=_11;
_startTime=objj_msgSend(_d,"timestamp");
_scrollingState=_CPMenuManagerScrollingStateNone;
_constraintRect=_f;
_menuContainerStack=[_e];
_trackingCallback=_10;
if(_11===objj_msgSend(CPApp,"mainMenu")){
var _12=objj_msgSend(_d,"globalLocation");
var _13=objj_msgSend(_e,"convertGlobalToBase:",_12);
var _14=objj_msgSend(_e,"itemIndexAtPoint:",_13),_15=_14!==CPNotFound?objj_msgSend(_11,"itemAtIndex:",_14):nil;
_menuBarButtonItemIndex=_14;
_menuBarButtonMenuContainer=_e;
if(objj_msgSend(_15,"_isMenuBarButton")){
return objj_msgSend(_b,"trackMenuBarButtonEvent:",_d);
}
}
objj_msgSend(_b,"trackEvent:",_d);
}
}),new objj_method(sel_getUid("trackEvent:"),function(_16,_17,_18){
with(_16){
var _19=objj_msgSend(_18,"type"),_1a=objj_msgSend(_16,"trackingMenu");
if(_19===CPAppKitDefined){
return objj_msgSend(_16,"completeTracking");
}
objj_msgSend(CPApp,"setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:",_16,sel_getUid("trackEvent:"),CPPeriodicMask|CPMouseMovedMask|CPLeftMouseDraggedMask|CPLeftMouseUpMask|CPAppKitDefinedMask,nil,nil,YES);
var _1b=_19===CPPeriodic?_lastGlobalLocation:objj_msgSend(_18,"globalLocation");
_lastGlobalLocation=_1b;
var _1c=objj_msgSend(_16,"menuContainerForPoint:",_1b),_1d=objj_msgSend(_1c,"menu"),_1e=objj_msgSend(_1c,"convertGlobalToBase:",_1b);
var _1f=_1c?objj_msgSend(_1c,"itemIndexAtPoint:",_1e):CPNotFound,_20=_1f!==CPNotFound?objj_msgSend(_1d,"itemAtIndex:",_1f):nil;
if(!objj_msgSend(_20,"isEnabled")||objj_msgSend(_20,"_isMenuBarButton")){
_1f=CPNotFound;
_20=nil;
}
var _21=objj_msgSend(_20,"view");
if(_19===CPPeriodic){
if(_scrollingState===_CPMenuManagerScrollingStateUp){
objj_msgSend(_1c,"scrollUp");
}else{
if(_scrollingState===_CPMenuManagerScrollingStateDown){
objj_msgSend(_1c,"scrollDown");
}
}
}
if(_21){
if(!_lastMouseOverMenuView){
objj_msgSend(_1d,"_highlightItemAtIndex:",CPNotFound);
}
if(_lastMouseOverMenuView!=_21){
objj_msgSend(_21,"mouseExited:",_18);
objj_msgSend(_lastMouseOverMenuView,"mouseEntered:",_18);
_lastMouseOverMenuView=_21;
}
var _22=_1c;
if(!objj_msgSend(_22,"isKindOfClass:",objj_msgSend(CPWindow,"class"))){
_22=objj_msgSend(_22,"window");
}
objj_msgSend(_22,"sendEvent:",objj_msgSend(CPEvent,"mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:",_19,_1e,objj_msgSend(_18,"modifierFlags"),objj_msgSend(_18,"timestamp"),_22,nil,0,objj_msgSend(_18,"clickCount"),objj_msgSend(_18,"pressure")));
}else{
if(_lastMouseOverMenuView){
objj_msgSend(_lastMouseOverMenuView,"mouseExited:",_18);
_lastMouseOverMenuView=nil;
}
objj_msgSend(_1d,"_highlightItemAtIndex:",_1f);
if(_19===CPMouseMoved||_19===CPLeftMouseDragged||_19===CPLeftMouseDown){
var _23=_scrollingState;
_scrollingState=objj_msgSend(_1c,"scrollingStateForPoint:",_1b);
if(_scrollingState!==_23){
if(_scrollingState===_CPMenuManagerScrollingStateNone){
objj_msgSend(CPEvent,"stopPeriodicEvents");
}else{
if(_23===_CPMenuManagerScrollingStateNone){
objj_msgSend(CPEvent,"startPeriodicEventsAfterDelay:withPeriod:",0,0.04);
}
}
}
}else{
if(_19===CPLeftMouseUp&&(objj_msgSend(_18,"timestamp")-_startTime>_1)){
objj_msgSend(_1a,"cancelTracking");
}
}
}
if(objj_msgSend(_20,"hasSubmenu")){
var _24=objj_msgSend(_1c,"rectForItemAtIndex:",_1f);
if(objj_msgSend(_1c,"isMenuBar")){
var _25=CGPointMake(CGRectGetMinX(_24),CGRectGetMaxY(_24));
}else{
var _25=CGPointMake(CGRectGetMaxX(_24),CGRectGetMinY(_24));
}
_25=objj_msgSend(_1c,"convertBaseToGlobal:",_25);
objj_msgSend(_16,"showMenu:fromMenu:atPoint:",objj_msgSend(_20,"submenu"),objj_msgSend(_20,"menu"),_25);
}else{
objj_msgSend(_16,"showMenu:fromMenu:atPoint:",nil,_1d,CGPointMakeZero());
}
}
}),new objj_method(sel_getUid("trackMenuBarButtonEvent:"),function(_26,_27,_28){
with(_26){
var _29=objj_msgSend(_28,"type");
if(_29===CPAppKitDefined){
return objj_msgSend(_26,"completeTracking");
}
var _2a=objj_msgSend(_28,"globalLocation");
var _2b=objj_msgSend(_26,"trackingMenu"),_2c=objj_msgSend(_26,"trackingMenuContainer"),_2d=objj_msgSend(_2c,"convertGlobalToBase:",_2a);
if(objj_msgSend(_2c,"itemIndexAtPoint:",_2d)===_menuBarButtonItemIndex){
objj_msgSend(_2b,"_highlightItemAtIndex:",_menuBarButtonItemIndex);
}else{
objj_msgSend(_2b,"_highlightItemAtIndex:",CPNotFound);
}
objj_msgSend(CPApp,"setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:",_26,sel_getUid("trackMenuBarButtonEvent:"),CPPeriodicMask|CPMouseMovedMask|CPLeftMouseDraggedMask|CPLeftMouseUpMask|CPAppKitDefinedMask,nil,nil,YES);
if(_29===CPLeftMouseUp){
objj_msgSend(_2b,"cancelTracking");
}
}
}),new objj_method(sel_getUid("completeTracking"),function(_2e,_2f){
with(_2e){
var _30=objj_msgSend(_2e,"trackingMenu");
objj_msgSend(CPEvent,"stopPeriodicEvents");
var _31=objj_msgSend(_30,"highlightedItem");
objj_msgSend(_2e,"showMenu:fromMenu:atPoint:",nil,_30,nil);
var _32=objj_msgSend(_30,"delegate");
if(objj_msgSend(_32,"respondsToSelector:",sel_getUid("menuDidClose:"))){
objj_msgSend(_32,"menuDidClose:",_30);
}
if(_trackingCallback){
_trackingCallback(objj_msgSend(_2e,"trackingMenuContainer"),_30);
}
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPMenuDidEndTrackingNotification,_30);
CPApp._activeMenu=nil;
}
}),new objj_method(sel_getUid("menuContainerForPoint:"),function(_33,_34,_35){
with(_33){
var _36=objj_msgSend(_menuContainerStack,"count"),_37=_menuContainerStack[0];
if(_36===1){
return _37;
}
var _38=0,_39=_36-1;
if(objj_msgSend(_37,"isMenuBar")){
if(CGRectContainsPoint(objj_msgSend(_37,"globalFrame"),_35)){
return _37;
}
_38=1;
}
var _3a=_36,x=_35.x,_3b=Infinity,_3c=nil;
while(_3a-->_38){
var _3d=_menuContainerStack[_3a],_3e=objj_msgSend(_3d,"globalFrame"),_3f=(_3e.origin.x),_40=(_3e.origin.x+_3e.size.width);
if(x<_40&&x>=_3f){
return _3d;
}
if(_3a===_38||_3a===_39){
var _41=ABS(x<_3f?_3f-x:_40-x);
if(_41<_3b){
_3c=_3d;
_3b=_41;
}
}
}
return _3c;
}
}),new objj_method(sel_getUid("showMenu:fromMenu:atPoint:"),function(_42,_43,_44,_45,_46){
with(_42){
var _47=_menuContainerStack.length,_48=_47;
while(_48--){
var _49=_menuContainerStack[_48],_4a=objj_msgSend(_49,"menu");
if(_4a===_45){
break;
}
if(_4a===_44){
return objj_msgSend(_44,"_highlightItemAtIndex:",CPNotFound);
}
objj_msgSend(_49,"orderOut:",_42);
objj_msgSend(_49,"setMenu:",nil);
objj_msgSend(_CPMenuWindow,"poolMenuWindow:",_49);
objj_msgSend(_menuContainerStack,"removeObjectAtIndex:",_48);
}
if(!_44){
return;
}
objj_msgSend(_44,"_highlightItemAtIndex:",CPNotFound);
var _4b=objj_msgSend(_CPMenuWindow,"menuWindowWithMenu:font:",_44,objj_msgSend(_menuContainerStack[0],"font"));
objj_msgSend(_menuContainerStack,"addObject:",_4b);
objj_msgSend(_4b,"setConstraintRect:",_constraintRect);
if(_45===objj_msgSend(_42,"trackingMenu")&&objj_msgSend(objj_msgSend(_42,"trackingMenuContainer"),"isMenuBar")){
objj_msgSend(_4b,"setBackgroundStyle:",_CPMenuWindowMenuBarBackgroundStyle);
}else{
objj_msgSend(_4b,"setBackgroundStyle:",_CPMenuWindowPopUpBackgroundStyle);
}
objj_msgSend(_4b,"setFrameOrigin:",_46);
objj_msgSend(_4b,"orderFront:",_42);
}
})]);
class_addMethods(_4,[new objj_method(sel_getUid("sharedMenuManager"),function(_4c,_4d){
with(_4c){
if(!_2){
_2=objj_msgSend(objj_msgSend(_CPMenuManager,"alloc"),"init");
}
return _2;
}
})]);
p;15;_CPMenuWindow.jt;17126;@STATIC;1.0;t;17106;
var _1=[],_2=5,_3=[];
_CPMenuWindowMenuBarBackgroundStyle=0;
_CPMenuWindowPopUpBackgroundStyle=1;
_CPMenuWindowAttachedMenuBackgroundStyle=2;
var _4=500,_5=5,_6=1,_7=1,_8=5,_9=16;
var _a=objj_allocateClassPair(CPWindow,"_CPMenuWindow"),_b=_a.isa;
class_addIvars(_a,[new objj_ivar("_menuView"),new objj_ivar("_menuClipView"),new objj_ivar("_moreAboveView"),new objj_ivar("_moreBelowView"),new objj_ivar("_unconstrainedFrame"),new objj_ivar("_constraintRect")]);
objj_registerClassPair(_a);
class_addMethods(_a,[new objj_method(sel_getUid("initWithContentRect:styleMask:"),function(_c,_d,_e,_f){
with(_c){
_constraintRect={origin:{x:0,y:0},size:{width:0,height:0}};
_unconstrainedFrame={origin:{x:0,y:0},size:{width:0,height:0}};
_c=objj_msgSendSuper({receiver:_c,super_class:objj_getClass("_CPMenuWindow").super_class},"initWithContentRect:styleMask:",_e,CPBorderlessWindowMask);
if(_c){
objj_msgSend(_c,"setLevel:",CPPopUpMenuWindowLevel);
objj_msgSend(_c,"setHasShadow:",YES);
objj_msgSend(_c,"setShadowStyle:",CPMenuWindowShadowStyle);
objj_msgSend(_c,"setAcceptsMouseMovedEvents:",YES);
var _10=objj_msgSend(_c,"contentView");
_menuView=objj_msgSend(objj_msgSend(_CPMenuView,"alloc"),"initWithFrame:",CGRectMakeZero());
_menuClipView=objj_msgSend(objj_msgSend(CPClipView,"alloc"),"initWithFrame:",CGRectMake(_6,_5,0,0));
objj_msgSend(_menuClipView,"setDocumentView:",_menuView);
objj_msgSend(_10,"addSubview:",_menuClipView);
_moreAboveView=objj_msgSend(objj_msgSend(CPImageView,"alloc"),"initWithFrame:",CGRectMakeZero());
objj_msgSend(_moreAboveView,"setImage:",_CPMenuWindowMoreAboveImage);
objj_msgSend(_moreAboveView,"setFrameSize:",objj_msgSend(_CPMenuWindowMoreAboveImage,"size"));
objj_msgSend(_10,"addSubview:",_moreAboveView);
_moreBelowView=objj_msgSend(objj_msgSend(CPImageView,"alloc"),"initWithFrame:",CGRectMakeZero());
objj_msgSend(_moreBelowView,"setImage:",_CPMenuWindowMoreBelowImage);
objj_msgSend(_moreBelowView,"setFrameSize:",objj_msgSend(_CPMenuWindowMoreBelowImage,"size"));
objj_msgSend(_10,"addSubview:",_moreBelowView);
objj_msgSend(_c,"setShadowStyle:",CPWindowShadowStyleMenu);
}
return _c;
}
}),new objj_method(sel_getUid("setFont:"),function(_11,_12,_13){
with(_11){
objj_msgSend(_menuView,"setFont:",_13);
}
}),new objj_method(sel_getUid("font"),function(_14,_15){
with(_14){
return objj_msgSend(_menuView,"font");
}
}),new objj_method(sel_getUid("setBackgroundStyle:"),function(_16,_17,_18){
with(_16){
objj_msgSend(_16,"setBackgroundColor:",objj_msgSend(objj_msgSend(_16,"class"),"backgroundColorForBackgroundStyle:",_18));
}
}),new objj_method(sel_getUid("setMenu:"),function(_19,_1a,_1b){
with(_19){
objj_msgSend(_1b,"_setMenuWindow:",_19);
objj_msgSend(_menuView,"setMenu:",_1b);
var _1c=objj_msgSend(_menuView,"frame").size;
objj_msgSend(_19,"setFrameSize:",CGSizeMake(_6+_1c.width+_7,_5+_1c.height+_8));
objj_msgSend(_menuView,"scrollPoint:",CGPointMake(0,0));
objj_msgSend(_menuClipView,"setFrame:",CGRectMake(_6,_5,_1c.width,_1c.height));
}
}),new objj_method(sel_getUid("setMinWidth:"),function(_1d,_1e,_1f){
with(_1d){
var _20=objj_msgSend(_1d,"unconstrainedFrame").size;
objj_msgSend(_1d,"setFrameSize:",CGSizeMake(MAX(_20.width,_1f),_20.height));
}
}),new objj_method(sel_getUid("menu"),function(_21,_22){
with(_21){
return objj_msgSend(_menuView,"menu");
}
}),new objj_method(sel_getUid("orderFront:"),function(_23,_24,_25){
with(_23){
objj_msgSend(_23,"setFrame:",_unconstrainedFrame);
objj_msgSendSuper({receiver:_23,super_class:objj_getClass("_CPMenuWindow").super_class},"orderFront:",_25);
}
}),new objj_method(sel_getUid("setConstraintRect:"),function(_26,_27,_28){
with(_26){
_constraintRect=_28;
objj_msgSend(_26,"setFrame:",_unconstrainedFrame);
}
}),new objj_method(sel_getUid("unconstrainedFrame"),function(_29,_2a){
with(_29){
return {origin:{x:_unconstrainedFrame.origin.x,y:_unconstrainedFrame.origin.y},size:{width:_unconstrainedFrame.size.width,height:_unconstrainedFrame.size.height}};
}
}),new objj_method(sel_getUid("setFrameOrigin:"),function(_2b,_2c,_2d){
with(_2b){
objj_msgSendSuper({receiver:_2b,super_class:objj_getClass("_CPMenuWindow").super_class},"setFrame:",{origin:{x:_2d.x,y:_2d.y},size:{width:(_unconstrainedFrame.size.width),height:(_unconstrainedFrame.size.height)}});
}
}),new objj_method(sel_getUid("setFrameSize:"),function(_2e,_2f,_30){
with(_2e){
objj_msgSendSuper({receiver:_2e,super_class:objj_getClass("_CPMenuWindow").super_class},"setFrame:",{origin:{x:(_unconstrainedFrame.origin.x),y:(_unconstrainedFrame.origin.y)},size:{width:_30.width,height:_30.height}});
}
}),new objj_method(sel_getUid("setFrame:display:animate:"),function(_31,_32,_33,_34,_35){
with(_31){
_unconstrainedFrame={origin:{x:_33.origin.x,y:_33.origin.y},size:{width:_33.size.width,height:_33.size.height}};
var _36=CGRectIntersection(_unconstrainedFrame,_constraintRect);
_36.origin.x=CGRectGetMinX(_unconstrainedFrame);
_36.size.width=CGRectGetWidth(_unconstrainedFrame);
if(CGRectGetWidth(_36)>CGRectGetWidth(_constraintRect)){
_36.size.width=CGRectGetWidth(_constraintRect);
}
if(CGRectGetMaxX(_36)>CGRectGetMaxX(_constraintRect)){
_36.origin.x-=CGRectGetMaxX(_36)-CGRectGetMaxX(_constraintRect);
}
if(CGRectGetMinX(_36)<CGRectGetMinX(_constraintRect)){
_36.origin.x=CGRectGetMinX(_constraintRect);
}
objj_msgSendSuper({receiver:_31,super_class:objj_getClass("_CPMenuWindow").super_class},"setFrame:display:animate:",_36,_34,_35);
var _37=CGPointMake(CGRectGetMinX(_33)+_6,CGRectGetMinY(_33)+_5),_38=_37.y<CGRectGetMinY(_36)+_5,_39=_37.y+CGRectGetHeight(objj_msgSend(_menuView,"frame"))>CGRectGetMaxY(_36)-_8,_3a=_5,_3b=_8,_3c=objj_msgSend(_31,"contentView"),_3d=objj_msgSend(_3c,"bounds");
if(_38){
_3a+=_9;
var _3e=objj_msgSend(_moreAboveView,"frame");
objj_msgSend(_moreAboveView,"setFrameOrigin:",CGPointMake((CGRectGetWidth(_3d)-CGRectGetWidth(_3e))/2,(_5+_9-CGRectGetHeight(_3e))/2));
}
objj_msgSend(_moreAboveView,"setHidden:",!_38);
if(_39){
_3b+=_9;
objj_msgSend(_moreBelowView,"setFrameOrigin:",CGPointMake((CGRectGetWidth(_3d)-CGRectGetWidth(objj_msgSend(_moreBelowView,"frame")))/2,CGRectGetHeight(_3d)-_9-_8));
}
objj_msgSend(_moreBelowView,"setHidden:",!_39);
var _3f=CGRectMake(_6,_3a,CGRectGetWidth(_36)-_6-_7,CGRectGetHeight(_36)-_3a-_3b);
objj_msgSend(_menuClipView,"setFrame:",_3f);
objj_msgSend(_menuView,"setFrameSize:",CGSizeMake(CGRectGetWidth(_3f),CGRectGetHeight(objj_msgSend(_menuView,"frame"))));
objj_msgSend(_menuView,"scrollPoint:",CGPointMake(0,objj_msgSend(_31,"convertBaseToGlobal:",_3f.origin).y-_37.y));
}
}),new objj_method(sel_getUid("hasMinimumNumberOfVisibleItems"),function(_40,_41){
with(_40){
var _42=objj_msgSend(_menuView,"visibleRect");
if(CGRectIsEmpty(_42)){
return NO;
}
var _43=objj_msgSend(_menuView,"numberOfUnhiddenItems"),_44=MIN(_43,3),_45=0,_46=objj_msgSend(_menuView,"itemIndexAtPoint:",objj_msgSend(_menuView,"convertPoint:fromView:",objj_msgSend(_menuClipView,"frame").origin,nil));
for(;_46<_43&&_45<_44;++_46){
var _47=objj_msgSend(_menuView,"rectForUnhiddenItemAtIndex:",_46),_48=CGRectIntersection(_42,_47);
if(CGRectIsEmpty(_48)){
break;
}
if(CGRectEqualToRect(_48,_47)){
++_45;
}
}
return _45>=_44;
}
}),new objj_method(sel_getUid("canScrollUp"),function(_49,_4a){
with(_49){
return !objj_msgSend(_moreAboveView,"isHidden");
}
}),new objj_method(sel_getUid("canScrollDown"),function(_4b,_4c){
with(_4b){
return !objj_msgSend(_moreBelowView,"isHidden");
}
}),new objj_method(sel_getUid("canScroll"),function(_4d,_4e){
with(_4d){
return objj_msgSend(_4d,"canScrollUp")||objj_msgSend(_4d,"canScrollDown");
}
}),new objj_method(sel_getUid("scrollUp"),function(_4f,_50){
with(_4f){
if(CGRectGetMinY(_unconstrainedFrame)>=CGRectGetMinY(_constraintRect)){
return;
}
_unconstrainedFrame.origin.y+=10;
objj_msgSend(_4f,"setFrame:",_unconstrainedFrame);
}
}),new objj_method(sel_getUid("scrollDown"),function(_51,_52){
with(_51){
if(CGRectGetMaxY(_unconstrainedFrame)<=CGRectGetHeight(_constraintRect)){
return;
}
_unconstrainedFrame.origin.y-=10;
objj_msgSend(_51,"setFrame:",_unconstrainedFrame);
}
})]);
class_addMethods(_b,[new objj_method(sel_getUid("menuWindowWithMenu:font:"),function(_53,_54,_55,_56){
with(_53){
var _57=nil;
if(_1.length){
_57=_1.pop();
objj_msgSend(_57,"setFrameOrigin:",CGPointMakeZero());
}else{
_57=objj_msgSend(objj_msgSend(_CPMenuWindow,"alloc"),"init");
}
objj_msgSend(_57,"setFont:",_56);
objj_msgSend(_57,"setMenu:",_55);
objj_msgSend(_57,"setMinWidth:",objj_msgSend(_55,"minimumWidth"));
return _57;
}
}),new objj_method(sel_getUid("poolMenuWindow:"),function(_58,_59,_5a){
with(_58){
if(!_5a||_1.length>=_2){
return;
}
_1.push(_5a);
}
}),new objj_method(sel_getUid("initialize"),function(_5b,_5c){
with(_5b){
if(_5b!=objj_msgSend(_CPMenuWindow,"class")){
return;
}
var _5d=objj_msgSend(CPBundle,"bundleForClass:",_5b);
_CPMenuWindowMoreAboveImage=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_5d,"pathForResource:","_CPMenuWindow/_CPMenuWindowMoreAbove.png"),CGSizeMake(38,18));
_CPMenuWindowMoreBelowImage=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_5d,"pathForResource:","_CPMenuWindow/_CPMenuWindowMoreBelow.png"),CGSizeMake(38,18));
}
}),new objj_method(sel_getUid("_standardLeftMargin"),function(_5e,_5f){
with(_5e){
return _6;
}
}),new objj_method(sel_getUid("backgroundColorForBackgroundStyle:"),function(_60,_61,_62){
with(_60){
var _63=_3[_62];
if(!_63){
var _64=objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(_60,"class"));
if(_62==_CPMenuWindowPopUpBackgroundStyle){
_63=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPNinePartImage,"alloc"),"initWithImageSlices:",[objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_64,"pathForResource:","_CPMenuWindow/_CPMenuWindowRounded0.png"),CGSizeMake(4,4)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_64,"pathForResource:","_CPMenuWindow/_CPMenuWindow1.png"),CGSizeMake(1,4)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_64,"pathForResource:","_CPMenuWindow/_CPMenuWindowRounded2.png"),CGSizeMake(4,4)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_64,"pathForResource:","_CPMenuWindow/_CPMenuWindow3.png"),CGSizeMake(4,1)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_64,"pathForResource:","_CPMenuWindow/_CPMenuWindow4.png"),CGSizeMake(1,1)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_64,"pathForResource:","_CPMenuWindow/_CPMenuWindow5.png"),CGSizeMake(4,1)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_64,"pathForResource:","_CPMenuWindow/_CPMenuWindowRounded6.png"),CGSizeMake(4,4)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_64,"pathForResource:","_CPMenuWindow/_CPMenuWindow7.png"),CGSizeMake(1,4)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_64,"pathForResource:","_CPMenuWindow/_CPMenuWindowRounded8.png"),CGSizeMake(4,4))]));
}else{
if(_62==_CPMenuWindowMenuBarBackgroundStyle){
_63=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPNinePartImage,"alloc"),"initWithImageSlices:",[objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_64,"pathForResource:","_CPMenuWindow/_CPMenuWindow3.png"),CGSizeMake(4,0)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_64,"pathForResource:","_CPMenuWindow/_CPMenuWindow4.png"),CGSizeMake(1,0)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_64,"pathForResource:","_CPMenuWindow/_CPMenuWindow5.png"),CGSizeMake(4,0)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_64,"pathForResource:","_CPMenuWindow/_CPMenuWindow3.png"),CGSizeMake(4,1)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_64,"pathForResource:","_CPMenuWindow/_CPMenuWindow4.png"),CGSizeMake(1,1)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_64,"pathForResource:","_CPMenuWindow/_CPMenuWindow5.png"),CGSizeMake(4,1)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_64,"pathForResource:","_CPMenuWindow/_CPMenuWindowRounded6.png"),CGSizeMake(4,4)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_64,"pathForResource:","_CPMenuWindow/_CPMenuWindow7.png"),CGSizeMake(1,4)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_64,"pathForResource:","_CPMenuWindow/_CPMenuWindowRounded8.png"),CGSizeMake(4,4))]));
}
}
_3[_62]=_63;
}
return _63;
}
})]);
var _a=objj_getClass("_CPMenuWindow");
if(!_a){
throw new SyntaxError("*** Could not find definition for class \"_CPMenuWindow\"");
}
var _b=_a.isa;
class_addMethods(_a,[new objj_method(sel_getUid("globalFrame"),function(_65,_66){
with(_65){
return objj_msgSend(_65,"frame");
}
}),new objj_method(sel_getUid("isMenuBar"),function(_67,_68){
with(_67){
return NO;
}
}),new objj_method(sel_getUid("scrollingStateForPoint:"),function(_69,_6a,_6b){
with(_69){
var _6c=objj_msgSend(_69,"frame");
if(!objj_msgSend(_69,"canScroll")){
return _CPMenuManagerScrollingStateNone;
}
if(_6b.y<CGRectGetMinY(_6c)+_5+_9){
return _CPMenuManagerScrollingStateUp;
}
if(_6b.y>CGRectGetMaxY(_6c)-_8-_9){
return _CPMenuManagerScrollingStateDown;
}
return _CPMenuManagerScrollingStateNone;
}
}),new objj_method(sel_getUid("deltaYForItemAtIndex:"),function(_6d,_6e,_6f){
with(_6d){
return _5+CGRectGetMinY(objj_msgSend(_menuView,"rectForItemAtIndex:",_6f));
}
}),new objj_method(sel_getUid("rectForItemAtIndex:"),function(_70,_71,_72){
with(_70){
return objj_msgSend(_menuView,"convertRect:toView:",objj_msgSend(_menuView,"rectForItemAtIndex:",_72),nil);
}
}),new objj_method(sel_getUid("itemIndexAtPoint:"),function(_73,_74,_75){
with(_73){
if(!CGRectContainsPoint(objj_msgSend(_menuClipView,"bounds"),objj_msgSend(_menuClipView,"convertPoint:fromView:",_75,nil))){
return NO;
}
return objj_msgSend(_menuView,"itemIndexAtPoint:",objj_msgSend(_menuView,"convertPoint:fromView:",_75,nil));
}
})]);
var _a=objj_allocateClassPair(CPView,"_CPMenuView"),_b=_a.isa;
class_addIvars(_a,[new objj_ivar("_menuItemViews"),new objj_ivar("_visibleMenuItemInfos"),new objj_ivar("_font")]);
objj_registerClassPair(_a);
class_addMethods(_a,[new objj_method(sel_getUid("font"),function(_76,_77){
with(_76){
return _font;
}
}),new objj_method(sel_getUid("setFont:"),function(_78,_79,_7a){
with(_78){
_font=_7a;
}
}),new objj_method(sel_getUid("numberOfUnhiddenItems"),function(_7b,_7c){
with(_7b){
return _visibleMenuItemInfos.length;
}
}),new objj_method(sel_getUid("rectForUnhiddenItemAtIndex:"),function(_7d,_7e,_7f){
with(_7d){
return objj_msgSend(_7d,"rectForItemAtIndex:",_visibleMenuItemInfos[_7f].index);
}
}),new objj_method(sel_getUid("rectForItemAtIndex:"),function(_80,_81,_82){
with(_80){
return objj_msgSend(_menuItemViews[_82===CPNotFound?0:_82],"frame");
}
}),new objj_method(sel_getUid("itemIndexAtPoint:"),function(_83,_84,_85){
with(_83){
var x=_85.x,_86=objj_msgSend(_83,"bounds");
if(x<CGRectGetMinX(_86)||x>CGRectGetMaxX(_86)){
return CPNotFound;
}
var y=_85.y,low=0,_87=_visibleMenuItemInfos.length-1;
while(low<=_87){
var _88=FLOOR(low+(_87-low)/2),_89=_visibleMenuItemInfos[_88];
frame=objj_msgSend(_89.view,"frame");
if(y<CGRectGetMinY(frame)){
_87=_88-1;
}else{
if(y>CGRectGetMaxY(frame)){
low=_88+1;
}else{
return _89.index;
}
}
}
return CPNotFound;
}
}),new objj_method(sel_getUid("tile"),function(_8a,_8b){
with(_8a){
objj_msgSend(_menuItemViews,"makeObjectsPerformSelector:",sel_getUid("removeFromSuperview"));
_menuItemViews=[];
_visibleMenuItemInfos=[];
var _8c=objj_msgSend(_8a,"menu");
if(!_8c){
return;
}
var _8d=objj_msgSend(_8c,"itemArray"),_8e=0,_8f=objj_msgSend(_8d,"count"),_90=0,y=0,_91=objj_msgSend(_8c,"showsStateColumn");
for(;_8e<_8f;++_8e){
var _92=_8d[_8e],_93=objj_msgSend(_92,"_menuItemView");
_menuItemViews.push(_93);
if(objj_msgSend(_92,"isHidden")){
continue;
}
_visibleMenuItemInfos.push({view:_93,index:_8e});
objj_msgSend(_93,"setFont:",_font);
objj_msgSend(_93,"setShowsStateColumn:",_91);
objj_msgSend(_93,"synchronizeWithMenuItem");
objj_msgSend(_93,"setFrameOrigin:",CGPointMake(0,y));
objj_msgSend(_8a,"addSubview:",_93);
var _94=objj_msgSend(_93,"minSize"),_95=_94.width;
if(_90<_95){
_90=_95;
}
y+=_94.height;
}
for(_8e=0;_8e<_8f;++_8e){
var _93=_menuItemViews[_8e];
objj_msgSend(_93,"setFrameSize:",CGSizeMake(_90,CGRectGetHeight(objj_msgSend(_93,"frame"))));
}
objj_msgSend(_8a,"setAutoresizesSubviews:",NO);
objj_msgSend(_8a,"setFrameSize:",CGSizeMake(_90,y));
objj_msgSend(_8a,"setAutoresizesSubviews:",YES);
}
}),new objj_method(sel_getUid("setMenu:"),function(_96,_97,_98){
with(_96){
objj_msgSendSuper({receiver:_96,super_class:objj_getClass("_CPMenuView").super_class},"setMenu:",_98);
objj_msgSend(_96,"tile");
}
})]);
p;8;CPMenu.jt;23326;@STATIC;1.0;I;20;Foundation/CPArray.jI;25;Foundation/CPDictionary.jI;33;Foundation/CPNotificationCenter.jI;21;Foundation/CPString.ji;16;_CPMenuManager.ji;15;CPApplication.ji;12;CPClipView.ji;12;CPMenuItem.ji;9;CPPanel.ji;18;_CPMenuBarWindow.ji;15;_CPMenuWindow.jt;23056;
objj_executeFile("Foundation/CPArray.j",NO);
objj_executeFile("Foundation/CPDictionary.j",NO);
objj_executeFile("Foundation/CPNotificationCenter.j",NO);
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("_CPMenuManager.j",YES);
objj_executeFile("CPApplication.j",YES);
objj_executeFile("CPClipView.j",YES);
objj_executeFile("CPMenuItem.j",YES);
objj_executeFile("CPPanel.j",YES);
CPMenuDidAddItemNotification="CPMenuDidAddItemNotification";
CPMenuDidChangeItemNotification="CPMenuDidChangeItemNotification";
CPMenuDidRemoveItemNotification="CPMenuDidRemoveItemNotification";
CPMenuDidEndTrackingNotification="CPMenuDidEndTrackingNotification";
var _1=28;
var _2=NO,_3="",_4=nil,_5=1,_6=nil,_7=nil;
var _8=objj_allocateClassPair(CPObject,"CPMenu"),_9=_8.isa;
class_addIvars(_8,[new objj_ivar("_supermenu"),new objj_ivar("_title"),new objj_ivar("_name"),new objj_ivar("_font"),new objj_ivar("_minimumWidth"),new objj_ivar("_items"),new objj_ivar("_autoenablesItems"),new objj_ivar("_showsStateColumn"),new objj_ivar("_delegate"),new objj_ivar("_highlightedIndex"),new objj_ivar("_menuWindow")]);
objj_registerClassPair(_8);
class_addMethods(_8,[new objj_method(sel_getUid("menuBarHeight"),function(_a,_b){
with(_a){
if(_a===objj_msgSend(CPApp,"mainMenu")){
return _1;
}
return 0;
}
}),new objj_method(sel_getUid("initWithTitle:"),function(_c,_d,_e){
with(_c){
_c=objj_msgSendSuper({receiver:_c,super_class:objj_getClass("CPMenu").super_class},"init");
if(_c){
_title=_e;
_items=[];
_autoenablesItems=YES;
_showsStateColumn=YES;
objj_msgSend(_c,"setMinimumWidth:",0);
}
return _c;
}
}),new objj_method(sel_getUid("init"),function(_f,_10){
with(_f){
return objj_msgSend(_f,"initWithTitle:","");
}
}),new objj_method(sel_getUid("insertItem:atIndex:"),function(_11,_12,_13,_14){
with(_11){
var _15=objj_msgSend(_13,"menu");
if(_15){
if(_15!==_11){
objj_msgSend(CPException,"raise:reason:",CPInternalInconsistencyException,"Attempted to insert item into menu that was already in another menu.");
}else{
return;
}
}
objj_msgSend(_13,"setMenu:",_11);
objj_msgSend(_items,"insertObject:atIndex:",_13,_14);
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:userInfo:",CPMenuDidAddItemNotification,_11,objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",_14,"CPMenuItemIndex"));
}
}),new objj_method(sel_getUid("insertItemWithTitle:action:keyEquivalent:atIndex:"),function(_16,_17,_18,_19,_1a,_1b){
with(_16){
var _1c=objj_msgSend(objj_msgSend(CPMenuItem,"alloc"),"initWithTitle:action:keyEquivalent:",_18,_19,_1a);
objj_msgSend(_16,"insertItem:atIndex:",_1c,_1b);
return _1c;
}
}),new objj_method(sel_getUid("addItem:"),function(_1d,_1e,_1f){
with(_1d){
objj_msgSend(_1d,"insertItem:atIndex:",_1f,objj_msgSend(_items,"count"));
}
}),new objj_method(sel_getUid("addItemWithTitle:action:keyEquivalent:"),function(_20,_21,_22,_23,_24){
with(_20){
return objj_msgSend(_20,"insertItemWithTitle:action:keyEquivalent:atIndex:",_22,_23,_24,objj_msgSend(_items,"count"));
}
}),new objj_method(sel_getUid("removeItem:"),function(_25,_26,_27){
with(_25){
objj_msgSend(_25,"removeItemAtIndex:",objj_msgSend(_items,"indexOfObjectIdenticalTo:",_27));
}
}),new objj_method(sel_getUid("removeItemAtIndex:"),function(_28,_29,_2a){
with(_28){
if(_2a<0||_2a>=_items.length){
return;
}
objj_msgSend(_items[_2a],"setMenu:",nil);
objj_msgSend(_items,"removeObjectAtIndex:",_2a);
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:userInfo:",CPMenuDidRemoveItemNotification,_28,objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",_2a,"CPMenuItemIndex"));
}
}),new objj_method(sel_getUid("itemChanged:"),function(_2b,_2c,_2d){
with(_2b){
if(objj_msgSend(_2d,"menu")!=_2b){
return;
}
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:userInfo:",CPMenuDidChangeItemNotification,_2b,objj_msgSend(CPDictionary,"dictionaryWithObject:forKey:",objj_msgSend(_items,"indexOfObjectIdenticalTo:",_2d),"CPMenuItemIndex"));
}
}),new objj_method(sel_getUid("itemWithTag:"),function(_2e,_2f,_30){
with(_2e){
var _31=objj_msgSend(_2e,"indexOfItemWithTag:",_30);
if(_31==CPNotFound){
return nil;
}
return _items[_31];
}
}),new objj_method(sel_getUid("itemWithTitle:"),function(_32,_33,_34){
with(_32){
var _35=objj_msgSend(_32,"indexOfItemWithTitle:",_34);
if(_35==CPNotFound){
return nil;
}
return _items[_35];
}
}),new objj_method(sel_getUid("itemAtIndex:"),function(_36,_37,_38){
with(_36){
return objj_msgSend(_items,"objectAtIndex:",_38);
}
}),new objj_method(sel_getUid("numberOfItems"),function(_39,_3a){
with(_39){
return objj_msgSend(_items,"count");
}
}),new objj_method(sel_getUid("itemArray"),function(_3b,_3c){
with(_3b){
return _items;
}
}),new objj_method(sel_getUid("indexOfItem:"),function(_3d,_3e,_3f){
with(_3d){
if(objj_msgSend(_3f,"menu")!==_3d){
return CPNotFound;
}
return objj_msgSend(_items,"indexOfObjectIdenticalTo:",_3f);
}
}),new objj_method(sel_getUid("indexOfItemWithTitle:"),function(_40,_41,_42){
with(_40){
var _43=0,_44=_items.length;
for(;_43<_44;++_43){
if(objj_msgSend(_items[_43],"title")===_42){
return _43;
}
}
return CPNotFound;
}
}),new objj_method(sel_getUid("indexOfItemWithTag:"),function(_45,_46,_47){
with(_45){
var _48=0,_49=_items.length;
for(;_48<_49;++_48){
if(objj_msgSend(_items[_48],"tag")==_47){
return _48;
}
}
return CPNotFound;
}
}),new objj_method(sel_getUid("indexOfItemWithTarget:andAction:"),function(_4a,_4b,_4c,_4d){
with(_4a){
var _4e=0,_4f=_items.length;
for(;_4e<_4f;++_4e){
var _50=_items[_4e];
if(objj_msgSend(_50,"target")==_4c&&(!_4d||objj_msgSend(_50,"action")==_4d)){
return _4e;
}
}
return CPNotFound;
}
}),new objj_method(sel_getUid("indexOfItemWithRepresentedObject:"),function(_51,_52,_53){
with(_51){
var _54=0,_55=_items.length;
for(;_54<_55;++_54){
if(objj_msgSend(objj_msgSend(_items[_54],"representedObject"),"isEqual:",_53)){
return _54;
}
}
return CPNotFound;
}
}),new objj_method(sel_getUid("indexOfItemWithSubmenu:"),function(_56,_57,_58){
with(_56){
var _59=0,_5a=_items.length;
for(;_59<_5a;++_59){
if(objj_msgSend(_items[_59],"submenu")==_58){
return _59;
}
}
return CPNotFound;
}
}),new objj_method(sel_getUid("setSubmenu:forItem:"),function(_5b,_5c,_5d,_5e){
with(_5b){
objj_msgSend(_5e,"setTarget:",_5e);
objj_msgSend(_5e,"setAction:",sel_getUid("submenuAction:"));
objj_msgSend(_5e,"setSubmenu:",_5d);
}
}),new objj_method(sel_getUid("submenuAction:"),function(_5f,_60,_61){
with(_5f){
}
}),new objj_method(sel_getUid("supermenu"),function(_62,_63){
with(_62){
return _supermenu;
}
}),new objj_method(sel_getUid("setSupermenu:"),function(_64,_65,_66){
with(_64){
_supermenu=_66;
}
}),new objj_method(sel_getUid("isTornOff"),function(_67,_68){
with(_67){
return !_supermenu||_67==objj_msgSend(CPApp,"mainMenu");
}
}),new objj_method(sel_getUid("setAutoenablesItems:"),function(_69,_6a,_6b){
with(_69){
_autoenablesItems=_6b;
}
}),new objj_method(sel_getUid("autoenablesItems"),function(_6c,_6d){
with(_6c){
return _autoenablesItems;
}
}),new objj_method(sel_getUid("update"),function(_6e,_6f){
with(_6e){
}
}),new objj_method(sel_getUid("setTitle:"),function(_70,_71,_72){
with(_70){
_title=_72;
}
}),new objj_method(sel_getUid("title"),function(_73,_74){
with(_73){
return _title;
}
}),new objj_method(sel_getUid("setMinimumWidth:"),function(_75,_76,_77){
with(_75){
_minimumWidth=_77;
}
}),new objj_method(sel_getUid("minimumWidth"),function(_78,_79){
with(_78){
return _minimumWidth;
}
}),new objj_method(sel_getUid("_performActionOfHighlightedItemChain"),function(_7a,_7b){
with(_7a){
var _7c=objj_msgSend(_7a,"highlightedItem");
while(objj_msgSend(_7c,"submenu")&&objj_msgSend(_7c,"action")===sel_getUid("submenuAction:")){
_7c=objj_msgSend(objj_msgSend(_7c,"submenu"),"highlightedItem");
}
if(_7c&&objj_msgSend(_7c,"isEnabled")){
objj_msgSend(CPApp,"sendAction:to:from:",objj_msgSend(_7c,"action"),objj_msgSend(_7c,"target"),_7c);
}
}
}),new objj_method(sel_getUid("popUpMenuPositioningItem:atLocation:inView:callback:"),function(_7d,_7e,_7f,_80,_81,_82){
with(_7d){
objj_msgSend(_7d,"_popUpMenuPositioningItem:atLocation:topY:bottomY:inView:callback:",_7f,_80,_80.y,_80.y,_81,_82);
}
}),new objj_method(sel_getUid("_popUpMenuPositioningItem:atLocation:topY:bottomY:inView:callback:"),function(_83,_84,_85,_86,_87,_88,_89,_8a){
with(_83){
var _8b=0;
if(_85){
_8b=objj_msgSend(_83,"indexOfItem:",_85);
if(_8b===CPNotFound){
throw "In call to popUpMenuPositioningItem:atLocation:inView:callback:, menu item "+_85+" is not present in menu "+_83;
}
}
var _8c=objj_msgSend(_89,"window");
if(_89&&!_8c){
throw "In call to popUpMenuPositioningItem:atLocation:inView:callback:, view is not in any window.";
}
var _8d=objj_msgSend(_83,"delegate");
if(objj_msgSend(_8d,"respondsToSelector:",sel_getUid("menuWillOpen:"))){
objj_msgSend(_8d,"menuWillOpen:",aMenu);
}
if(_89){
_86=objj_msgSend(_8c,"convertBaseToGlobal:",objj_msgSend(_89,"convertPoint:toView:",_86,nil));
}
var _8e=objj_msgSend(_CPMenuWindow,"menuWindowWithMenu:font:",_83,objj_msgSend(_83,"font"));
objj_msgSend(_8e,"setBackgroundStyle:",_CPMenuWindowPopUpBackgroundStyle);
if(_85){
_86.y-=objj_msgSend(_8e,"deltaYForItemAtIndex:",_8b);
}
var _8f=objj_msgSend(CPMenu,"_constraintRectForView:",_89);
objj_msgSend(_8e,"setFrameOrigin:",_86);
objj_msgSend(_8e,"setConstraintRect:",_8f);
if(!objj_msgSend(_8e,"hasMinimumNumberOfVisibleItems")){
var _90=objj_msgSend(_8e,"unconstrainedFrame"),_91=CGRectGetMinY(_90);
if(_91>=CGRectGetMaxY(_8f)||objj_msgSend(_8e,"canScrollDown")){
if(_89){
_87=objj_msgSend(_8c,"convertBaseToGlobal:",objj_msgSend(_89,"convertPoint:toView:",CGPointMake(0,_87),nil)).y;
}
_90.origin.y=MIN(CGRectGetMaxY(_8f),_87)-CGRectGetHeight(_90);
}else{
if(_91<CGRectGetMinY(_8f)||objj_msgSend(_8e,"canScrollUp")){
if(_89){
_88=objj_msgSend(_8c,"convertBaseToGlobal:",objj_msgSend(_89,"convertPoint:toView:",CGPointMake(0,_88),nil)).y;
}
_90.origin.y=MAX(CGRectGetMinY(_8f),_88);
}
}
objj_msgSend(_8e,"setFrameOrigin:",CGRectIntersection(_90,_8f).origin);
}
objj_msgSend(_8e,"orderFront:",_83);
objj_msgSend(objj_msgSend(_CPMenuManager,"sharedMenuManager"),"beginTracking:menuContainer:constraintRect:callback:",objj_msgSend(CPApp,"currentEvent"),_8e,_8f,objj_msgSend(CPMenu,"trackingCallbackWithCallback:",_8a));
}
}),new objj_method(sel_getUid("setShowsStateColumn:"),function(_92,_93,_94){
with(_92){
_showsStateColumn=_94;
}
}),new objj_method(sel_getUid("showsStateColumn"),function(_95,_96){
with(_95){
return _showsStateColumn;
}
}),new objj_method(sel_getUid("highlightedItem"),function(_97,_98){
with(_97){
return _highlightedIndex>=0?_items[_highlightedIndex]:nil;
}
}),new objj_method(sel_getUid("setDelegate:"),function(_99,_9a,_9b){
with(_99){
_delegate=_9b;
}
}),new objj_method(sel_getUid("delegate"),function(_9c,_9d){
with(_9c){
return _delegate;
}
}),new objj_method(sel_getUid("cancelTracking"),function(_9e,_9f){
with(_9e){
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"performSelector:target:argument:order:modes:",sel_getUid("_fireCancelTrackingEvent"),_9e,nil,0,[CPDefaultRunLoopMode]);
}
}),new objj_method(sel_getUid("_fireCancelTrackingEvent"),function(_a0,_a1){
with(_a0){
objj_msgSend(CPApp,"sendEvent:",objj_msgSend(CPEvent,"otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:",CPAppKitDefined,{x:0,y:0},0,0,0,0,0,0,0));
objj_msgSend(_CPDisplayServer,"run");
}
}),new objj_method(sel_getUid("_setMenuWindow:"),function(_a2,_a3,_a4){
with(_a2){
_menuWindow=_a4;
}
}),new objj_method(sel_getUid("setFont:"),function(_a5,_a6,_a7){
with(_a5){
_font=_a7;
}
}),new objj_method(sel_getUid("font"),function(_a8,_a9){
with(_a8){
return _font;
}
}),new objj_method(sel_getUid("performKeyEquivalent:"),function(_aa,_ab,_ac){
with(_aa){
if(_autoenablesItems){
objj_msgSend(_aa,"update");
}
var _ad=0,_ae=_items.length,_af=objj_msgSend(_ac,"charactersIgnoringModifiers"),_b0=objj_msgSend(_ac,"modifierFlags");
for(;_ad<_ae;++_ad){
var _b1=_items[_ad],_b2=objj_msgSend(_b1,"keyEquivalentModifierMask");
if(objj_msgSend(_b1,"keyEquivalent")===objj_msgSend(objj_msgSend(_b1,"keyEquivalent"),"uppercaseString")){
_b2|=CPShiftKeyMask;
}
if(CPBrowserIsOperatingSystem(CPWindowsOperatingSystem)&&(_b2&CPCommandKeyMask)){
_b2|=CPControlKeyMask;
_b2&=~CPCommandKeyMask;
}
if((_b0&(CPShiftKeyMask|CPAlternateKeyMask|CPCommandKeyMask|CPControlKeyMask))==_b2&&objj_msgSend(_af,"caseInsensitiveCompare:",objj_msgSend(_b1,"keyEquivalent"))==CPOrderedSame){
if(objj_msgSend(_b1,"isEnabled")){
objj_msgSend(_aa,"performActionForItemAtIndex:",_ad);
}else{
}
return YES;
}
if(objj_msgSend(objj_msgSend(_b1,"submenu"),"performKeyEquivalent:",_ac)){
return YES;
}
}
return NO;
}
}),new objj_method(sel_getUid("performActionForItemAtIndex:"),function(_b3,_b4,_b5){
with(_b3){
var _b6=_items[_b5];
objj_msgSend(CPApp,"sendAction:to:from:",objj_msgSend(_b6,"action"),objj_msgSend(_b6,"target"),_b6);
}
}),new objj_method(sel_getUid("_itemIsHighlighted:"),function(_b7,_b8,_b9){
with(_b7){
return _items[_highlightedIndex]==_b9;
}
}),new objj_method(sel_getUid("_highlightItemAtIndex:"),function(_ba,_bb,_bc){
with(_ba){
if(_highlightedIndex===_bc){
return;
}
if(_highlightedIndex!==CPNotFound){
objj_msgSend(objj_msgSend(_items[_highlightedIndex],"_menuItemView"),"highlight:",NO);
}
_highlightedIndex=_bc;
if(_highlightedIndex!==CPNotFound){
objj_msgSend(objj_msgSend(_items[_highlightedIndex],"_menuItemView"),"highlight:",YES);
}
}
}),new objj_method(sel_getUid("_setMenuName:"),function(_bd,_be,_bf){
with(_bd){
if(_name===_bf){
return;
}
_name=_bf;
if(_name==="CPMainMenu"){
objj_msgSend(CPApp,"setMainMenu:",_bd);
}
}
}),new objj_method(sel_getUid("_menuName"),function(_c0,_c1){
with(_c0){
return _name;
}
}),new objj_method(sel_getUid("awakeFromCib"),function(_c2,_c3){
with(_c2){
if(_name==="_CPMainMenu"){
objj_msgSend(_c2,"_setMenuName:","CPMainMenu");
objj_msgSend(CPMenu,"setMenuBarVisible:",YES);
}
}
}),new objj_method(sel_getUid("_menuWithName:"),function(_c4,_c5,_c6){
with(_c4){
if(_c6===_name){
return _c4;
}
for(var i=0,_c7=objj_msgSend(_items,"count");i<_c7;i++){
var _c8=objj_msgSend(objj_msgSend(_items[i],"submenu"),"_menuWithName:",_c6);
if(_c8){
return _c8;
}
}
return nil;
}
})]);
class_addMethods(_9,[new objj_method(sel_getUid("initialize"),function(_c9,_ca){
with(_c9){
objj_msgSend(objj_msgSend(_c9,"class"),"setMenuBarAttributes:",objj_msgSend(CPDictionary,"dictionary"));
}
}),new objj_method(sel_getUid("menuBarVisible"),function(_cb,_cc){
with(_cb){
return _2;
}
}),new objj_method(sel_getUid("setMenuBarVisible:"),function(_cd,_ce,_cf){
with(_cd){
if(_2===_cf){
return;
}
_2=_cf;
if(objj_msgSend(CPPlatform,"supportsNativeMainMenu")){
return;
}
if(_cf){
if(!_7){
_7=objj_msgSend(objj_msgSend(_CPMenuBarWindow,"alloc"),"init");
}
objj_msgSend(_7,"setMenu:",objj_msgSend(CPApp,"mainMenu"));
objj_msgSend(_7,"setTitle:",_3);
objj_msgSend(_7,"setIconImage:",_4);
objj_msgSend(_7,"setIconImageAlphaValue:",_5);
objj_msgSend(_7,"setColor:",objj_msgSend(_6,"objectForKey:","CPMenuBarBackgroundColor"));
objj_msgSend(_7,"setTextColor:",objj_msgSend(_6,"objectForKey:","CPMenuBarTextColor"));
objj_msgSend(_7,"setTitleColor:",objj_msgSend(_6,"objectForKey:","CPMenuBarTitleColor"));
objj_msgSend(_7,"setTextShadowColor:",objj_msgSend(_6,"objectForKey:","CPMenuBarTextShadowColor"));
objj_msgSend(_7,"setTitleShadowColor:",objj_msgSend(_6,"objectForKey:","CPMenuBarTitleShadowColor"));
objj_msgSend(_7,"setHighlightColor:",objj_msgSend(_6,"objectForKey:","CPMenuBarHighlightColor"));
objj_msgSend(_7,"setHighlightTextColor:",objj_msgSend(_6,"objectForKey:","CPMenuBarHighlightTextColor"));
objj_msgSend(_7,"setHighlightTextShadowColor:",objj_msgSend(_6,"objectForKey:","CPMenuBarHighlightTextShadowColor"));
objj_msgSend(_7,"orderFront:",_cd);
}else{
objj_msgSend(_7,"orderOut:",_cd);
}
objj_msgSend(objj_msgSend(CPPlatformWindow,"primaryPlatformWindow"),"resizeEvent:",nil);
}
}),new objj_method(sel_getUid("setMenuBarTitle:"),function(_d0,_d1,_d2){
with(_d0){
_3=_d2;
objj_msgSend(_7,"setTitle:",_3);
}
}),new objj_method(sel_getUid("menuBarTitle"),function(_d3,_d4){
with(_d3){
return _3;
}
}),new objj_method(sel_getUid("setMenuBarIconImage:"),function(_d5,_d6,_d7){
with(_d5){
_CPMenuBarImage=_d7;
objj_msgSend(_7,"setIconImage:",_d7);
}
}),new objj_method(sel_getUid("menuBarIconImage"),function(_d8,_d9){
with(_d8){
return _CPMenuBarImage;
}
}),new objj_method(sel_getUid("setMenuBarAttributes:"),function(_da,_db,_dc){
with(_da){
if(_6==_dc){
return;
}
_6=objj_msgSend(_dc,"copy");
var _dd=objj_msgSend(_dc,"objectForKey:","CPMenuBarTextColor"),_de=objj_msgSend(_dc,"objectForKey:","CPMenuBarTitleColor"),_df=objj_msgSend(_dc,"objectForKey:","CPMenuBarTextShadowColor"),_e0=objj_msgSend(_dc,"objectForKey:","CPMenuBarTitleShadowColor"),_e1=objj_msgSend(_dc,"objectForKey:","CPMenuBarHighlightColor"),_e2=objj_msgSend(_dc,"objectForKey:","CPMenuBarHighlightTextColor"),_e3=objj_msgSend(_dc,"objectForKey:","CPMenuBarHighlightTextShadowColor");
if(!_dd&&_de){
objj_msgSend(_6,"setObject:forKey:",_de,"CPMenuBarTextColor");
}else{
if(_dd&&!_de){
objj_msgSend(_6,"setObject:forKey:",_dd,"CPMenuBarTitleColor");
}else{
if(!_dd&&!_de){
objj_msgSend(_6,"setObject:forKey:",objj_msgSend(CPColor,"colorWithRed:green:blue:alpha:",0.051,0.2,0.275,1),"CPMenuBarTextColor");
objj_msgSend(_6,"setObject:forKey:",objj_msgSend(CPColor,"colorWithRed:green:blue:alpha:",0.051,0.2,0.275,1),"CPMenuBarTitleColor");
}
}
}
if(!_df&&_e0){
objj_msgSend(_6,"setObject:forKey:",_e0,"CPMenuBarTextShadowColor");
}else{
if(_df&&!_e0){
objj_msgSend(_6,"setObject:forKey:",_df,"CPMenuBarTitleShadowColor");
}else{
if(!_df&&!_e0){
objj_msgSend(_6,"setObject:forKey:",objj_msgSend(CPColor,"whiteColor"),"CPMenuBarTextShadowColor");
objj_msgSend(_6,"setObject:forKey:",objj_msgSend(CPColor,"whiteColor"),"CPMenuBarTitleShadowColor");
}
}
}
if(!_e1){
objj_msgSend(_6,"setObject:forKey:",objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",94/255,130/255,186/255,1),"CPMenuBarHighlightColor");
}
if(!_e2){
objj_msgSend(_6,"setObject:forKey:",objj_msgSend(CPColor,"whiteColor"),"CPMenuBarHighlightTextColor");
}
if(!_e3){
objj_msgSend(_6,"setObject:forKey:",objj_msgSend(CPColor,"blackColor"),"CPMenuBarHighlightTextShadowColor");
}
if(_7){
objj_msgSend(_7,"setColor:",objj_msgSend(_6,"objectForKey:","CPMenuBarBackgroundColor"));
objj_msgSend(_7,"setTextColor:",objj_msgSend(_6,"objectForKey:","CPMenuBarTextColor"));
objj_msgSend(_7,"setTitleColor:",objj_msgSend(_6,"objectForKey:","CPMenuBarTitleColor"));
objj_msgSend(_7,"setTextShadowColor:",objj_msgSend(_6,"objectForKey:","CPMenuBarTextShadowColor"));
objj_msgSend(_7,"setTitleShadowColor:",objj_msgSend(_6,"objectForKey:","CPMenuBarTitleShadowColor"));
objj_msgSend(_7,"setHighlightColor:",objj_msgSend(_6,"objectForKey:","CPMenuBarHighlightColor"));
objj_msgSend(_7,"setHighlightTextColor:",objj_msgSend(_6,"objectForKey:","CPMenuBarHighlightTextColor"));
objj_msgSend(_7,"setHighlightTextShadowColor:",objj_msgSend(_6,"objectForKey:","CPMenuBarHighlightTextShadowColor"));
}
}
}),new objj_method(sel_getUid("menuBarAttributes"),function(_e4,_e5){
with(_e4){
return _6;
}
}),new objj_method(sel_getUid("_setMenuBarIconImageAlphaValue:"),function(_e6,_e7,_e8){
with(_e6){
_5=_e8;
objj_msgSend(_7,"setIconImageAlphaValue:",_e8);
}
}),new objj_method(sel_getUid("menuBarHeight"),function(_e9,_ea){
with(_e9){
return _1;
}
}),new objj_method(sel_getUid("_constraintRectForView:"),function(_eb,_ec,_ed){
with(_eb){
if(objj_msgSend(CPPlatform,"isBrowser")){
return CGRectInset(objj_msgSend(objj_msgSend(objj_msgSend(_ed,"window"),"platformWindow"),"contentBounds"),5,5);
}
return CGRectInset(objj_msgSend(objj_msgSend(objj_msgSend(_ed,"window"),"screen"),"visibleFrame"),5,5);
}
}),new objj_method(sel_getUid("trackingCallbackWithCallback:"),function(_ee,_ef,_f0){
with(_ee){
return function(_f1,_f2){
objj_msgSend(_f1,"setMenu:",nil);
objj_msgSend(_f1,"orderOut:",_ee);
objj_msgSend(_CPMenuWindow,"poolMenuWindow:",_f1);
if(_f0){
_f0(_f2);
}
objj_msgSend(_f2,"_performActionOfHighlightedItemChain");
};
}
}),new objj_method(sel_getUid("popUpContextMenu:withEvent:forView:"),function(_f3,_f4,_f5,_f6,_f7){
with(_f3){
objj_msgSend(_f3,"popUpContextMenu:withEvent:forView:withFont:",_f5,_f6,_f7,nil);
}
}),new objj_method(sel_getUid("popUpContextMenu:withEvent:forView:withFont:"),function(_f8,_f9,_fa,_fb,_fc,_fd){
with(_f8){
var _fe=objj_msgSend(_fa,"delegate");
if(objj_msgSend(_fe,"respondsToSelector:",sel_getUid("menuWillOpen:"))){
objj_msgSend(_fe,"menuWillOpen:",_fa);
}
if(!_fd){
_fd=objj_msgSend(CPFont,"systemFontOfSize:",12);
}
var _ff=objj_msgSend(_fc,"window"),_100=objj_msgSend(_CPMenuWindow,"menuWindowWithMenu:font:",_fa,_fd);
objj_msgSend(_100,"setBackgroundStyle:",_CPMenuWindowPopUpBackgroundStyle);
var _101=objj_msgSend(CPMenu,"_constraintRectForView:",_fc),_102=objj_msgSend(objj_msgSend(_fb,"window"),"convertBaseToGlobal:",objj_msgSend(_fb,"locationInWindow"));
objj_msgSend(_100,"setConstraintRect:",_101);
objj_msgSend(_100,"setFrameOrigin:",_102);
if(!objj_msgSend(_100,"hasMinimumNumberOfVisibleItems")){
var _103=objj_msgSend(_100,"unconstrainedFrame"),_104=CGRectGetMinY(_103);
if(_104>=CGRectGetMaxY(_101)||objj_msgSend(_100,"canScrollDown")){
_103.origin.y=MIN(CGRectGetMaxY(_101),_102.y)-CGRectGetHeight(_103);
}else{
if(_104<CGRectGetMinY(_101)||objj_msgSend(_100,"canScrollUp")){
_103.origin.y=MAX(CGRectGetMinY(_101),_102.y);
}
}
objj_msgSend(_100,"setFrameOrigin:",CGRectIntersection(_103,_101).origin);
}
objj_msgSend(_100,"orderFront:",_f8);
objj_msgSend(objj_msgSend(_CPMenuManager,"sharedMenuManager"),"beginTracking:menuContainer:constraintRect:callback:",_fb,_100,objj_msgSend(CPMenu,"_constraintRectForView:",_fc),objj_msgSend(CPMenu,"trackingCallbackWithCallback:",nil));
}
})]);
var _105="CPMenuTitleKey",_106="CPMenuNameKey",_107="CPMenuItemsKey",_108="CPMenuShowsStateColumnKey";
var _8=objj_getClass("CPMenu");
if(!_8){
throw new SyntaxError("*** Could not find definition for class \"CPMenu\"");
}
var _9=_8.isa;
class_addMethods(_8,[new objj_method(sel_getUid("initWithCoder:"),function(self,_109,_10a){
with(self){
self=objj_msgSendSuper({receiver:self,super_class:objj_getClass("CPMenu").super_class},"init");
if(self){
_title=objj_msgSend(_10a,"decodeObjectForKey:",_105);
_items=objj_msgSend(_10a,"decodeObjectForKey:",_107);
objj_msgSend(self,"_setMenuName:",objj_msgSend(_10a,"decodeObjectForKey:",_106));
_showsStateColumn=!objj_msgSend(_10a,"containsValueForKey:",_108)||objj_msgSend(_10a,"decodeBoolForKey:",_108);
objj_msgSend(self,"setMinimumWidth:",0);
}
return self;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(self,_10b,_10c){
with(self){
objj_msgSend(_10c,"encodeObject:forKey:",_title,_105);
if(_name){
objj_msgSend(_10c,"encodeObject:forKey:",_name,_106);
}
objj_msgSend(_10c,"encodeObject:forKey:",_items,_107);
if(!_showsStateColumn){
objj_msgSend(_10c,"encodeBool:forKey:",_showsStateColumn,_108);
}
}
})]);
objj_executeFile("_CPMenuBarWindow.j",YES);
objj_executeFile("_CPMenuWindow.j",YES);
p;24;_CPMenuItemMenuBarView.jt;7593;@STATIC;1.0;t;7574;
var _1=8,_2=3,_3=4;
var _4=nil,_5=nil,_6=nil,_7=nil,_8=[],_9=[];
var _a=objj_allocateClassPair(CPView,"_CPMenuItemMenuBarView"),_b=_a.isa;
class_addIvars(_a,[new objj_ivar("_menuItem"),new objj_ivar("_font"),new objj_ivar("_textColor"),new objj_ivar("_textShadowColor"),new objj_ivar("_isDirty"),new objj_ivar("_imageAndTextView"),new objj_ivar("_submenuIndicatorView")]);
objj_registerClassPair(_a);
class_addMethods(_a,[new objj_method(sel_getUid("menuItem"),function(_c,_d){
with(_c){
return _menuItem;
}
}),new objj_method(sel_getUid("setMenuItem:"),function(_e,_f,_10){
with(_e){
_menuItem=_10;
}
}),new objj_method(sel_getUid("initWithFrame:"),function(_11,_12,_13){
with(_11){
_11=objj_msgSendSuper({receiver:_11,super_class:objj_getClass("_CPMenuItemMenuBarView").super_class},"initWithFrame:",_13);
if(_11){
_imageAndTextView=objj_msgSend(objj_msgSend(_CPImageAndTextView,"alloc"),"initWithFrame:",CGRectMake(_1,0,0,0));
objj_msgSend(_imageAndTextView,"setImagePosition:",CPImageLeft);
objj_msgSend(_imageAndTextView,"setTextShadowOffset:",CGSizeMake(0,1));
objj_msgSend(_imageAndTextView,"setAutoresizingMask:",CPViewMinYMargin|CPViewMaxYMargin);
objj_msgSend(_11,"addSubview:",_imageAndTextView);
_submenuIndicatorView=objj_msgSend(objj_msgSend(_CPMenuItemMenuBarSubmenuIndicatorView,"alloc"),"initWithFrame:",CGRectMake(0,0,9,6));
objj_msgSend(_submenuIndicatorView,"setAutoresizingMask:",CPViewMinYMargin|CPViewMaxYMargin);
objj_msgSend(_11,"addSubview:",_submenuIndicatorView);
objj_msgSend(_11,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
}
return _11;
}
}),new objj_method(sel_getUid("textColor"),function(_14,_15){
with(_14){
if(!objj_msgSend(_menuItem,"isEnabled")){
return objj_msgSend(CPColor,"lightGrayColor");
}
return _textColor||objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",70/255,69/255,69/255,1);
}
}),new objj_method(sel_getUid("textShadowColor"),function(_16,_17){
with(_16){
if(!objj_msgSend(_menuItem,"isEnabled")){
return objj_msgSend(CPColor,"colorWithWhite:alpha:",0.8,0.8);
}
return _textShadowColor||objj_msgSend(CPColor,"colorWithWhite:alpha:",1,0.8);
}
}),new objj_method(sel_getUid("update"),function(_18,_19){
with(_18){
var x=_1,_1a=0;
objj_msgSend(_imageAndTextView,"setFont:",objj_msgSend(_menuItem,"font")||objj_msgSend(_CPMenuBarWindow,"font"));
objj_msgSend(_imageAndTextView,"setVerticalAlignment:",CPCenterVerticalTextAlignment);
objj_msgSend(_imageAndTextView,"setImage:",objj_msgSend(_menuItem,"image"));
objj_msgSend(_imageAndTextView,"setText:",objj_msgSend(_menuItem,"title"));
objj_msgSend(_imageAndTextView,"setTextColor:",objj_msgSend(_18,"textColor"));
objj_msgSend(_imageAndTextView,"setTextShadowColor:",objj_msgSend(_18,"textShadowColor"));
objj_msgSend(_imageAndTextView,"setTextShadowOffset:",CGSizeMake(0,1));
objj_msgSend(_imageAndTextView,"sizeToFit");
var _1b=objj_msgSend(_imageAndTextView,"frame");
_1b.origin.x=x;
x+=CGRectGetWidth(_1b);
_1a=MAX(_1a,CGRectGetHeight(_1b));
var _1c=objj_msgSend(_menuItem,"hasSubmenu")&&objj_msgSend(_menuItem,"action");
if(_1c){
objj_msgSend(_submenuIndicatorView,"setHidden:",NO);
objj_msgSend(_submenuIndicatorView,"setColor:",objj_msgSend(_18,"textColor"));
objj_msgSend(_submenuIndicatorView,"setShadowColor:",objj_msgSend(_18,"textShadowColor"));
var _1d=objj_msgSend(_submenuIndicatorView,"frame");
_1d.origin.x=x+_2;
x=CGRectGetMaxX(_1d);
_1a=MAX(_1a,CGRectGetHeight(_1d));
}else{
objj_msgSend(_submenuIndicatorView,"setHidden:",YES);
}
_1a+=2*_3;
_1b.origin.y=FLOOR((_1a-CGRectGetHeight(_1b))/2);
objj_msgSend(_imageAndTextView,"setFrame:",_1b);
if(_1c){
_1d.origin.y=FLOOR((_1a-CGRectGetHeight(_1d))/2)+1;
objj_msgSend(_submenuIndicatorView,"setFrame:",_1d);
}
_minSize=CGSizeMake(x+_1,_1a);
objj_msgSend(_18,"setAutoresizesSubviews:",NO);
objj_msgSend(_18,"setFrameSize:",_minSize);
objj_msgSend(_18,"setAutoresizesSubviews:",YES);
}
}),new objj_method(sel_getUid("highlight:"),function(_1e,_1f,_20){
with(_1e){
if(!objj_msgSend(_menuItem,"isEnabled")){
_20=NO;
}
if(_20){
if(!objj_msgSend(_menuItem,"_isMenuBarButton")){
objj_msgSend(_1e,"setBackgroundColor:",_4);
}
objj_msgSend(_imageAndTextView,"setImage:",objj_msgSend(_menuItem,"alternateImage")||objj_msgSend(_menuItem,"image"));
objj_msgSend(_imageAndTextView,"setTextColor:",objj_msgSend(CPColor,"whiteColor"));
objj_msgSend(_imageAndTextView,"setTextShadowColor:",_7);
objj_msgSend(_submenuIndicatorView,"setColor:",objj_msgSend(CPColor,"whiteColor"));
objj_msgSend(_submenuIndicatorView,"setShadowColor:",objj_msgSend(CPColor,"colorWithWhite:alpha:",0.1,0.7));
}else{
objj_msgSend(_1e,"setBackgroundColor:",nil);
objj_msgSend(_imageAndTextView,"setImage:",objj_msgSend(_menuItem,"image"));
objj_msgSend(_imageAndTextView,"setTextColor:",objj_msgSend(_1e,"textColor"));
objj_msgSend(_imageAndTextView,"setTextShadowColor:",objj_msgSend(_1e,"textShadowColor"));
objj_msgSend(_submenuIndicatorView,"setColor:",objj_msgSend(_1e,"textColor"));
objj_msgSend(_submenuIndicatorView,"setShadowColor:",objj_msgSend(_1e,"textShadowColor"));
}
}
})]);
class_addMethods(_b,[new objj_method(sel_getUid("initialize"),function(_21,_22){
with(_21){
if(_21!==objj_msgSend(_CPMenuItemMenuBarView,"class")){
return;
}
var _23=objj_msgSend(CPBundle,"bundleForClass:",_21);
_4=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_23,"pathForResource:","_CPMenuBarWindow/_CPMenuBarWindowBackgroundSelected.png"),CGSizeMake(1,28)));
_5=objj_msgSend(CPColor,"grayColor");
_6=objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",95/255,131/255,185/255,1);
_7=objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",26/255,73/255,109/255,1);
_8[CPOffState]=nil;
_9[CPOffState]=nil;
_8[CPOnState]=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_23,"pathForResource:","CPMenuItem/CPMenuItemOnState.png"),CGSizeMake(14,14));
_9[CPOnState]=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_23,"pathForResource:","CPMenuItem/CPMenuItemOnStateHighlighted.png"),CGSizeMake(14,14));
_8[CPMixedState]=nil;
_9[CPMixedState]=nil;
}
}),new objj_method(sel_getUid("view"),function(_24,_25){
with(_24){
return objj_msgSend(objj_msgSend(_24,"alloc"),"init");
}
})]);
var _a=objj_allocateClassPair(CPView,"_CPMenuItemMenuBarSubmenuIndicatorView"),_b=_a.isa;
class_addIvars(_a,[new objj_ivar("_color"),new objj_ivar("_shadowColor")]);
objj_registerClassPair(_a);
class_addMethods(_a,[new objj_method(sel_getUid("setColor:"),function(_26,_27,_28){
with(_26){
if(_color===_28){
return;
}
_color=_28;
objj_msgSend(_26,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("setShadowColor:"),function(_29,_2a,_2b){
with(_29){
if(_shadowColor===_2b){
return;
}
_shadowColor=_2b;
objj_msgSend(_29,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("drawRect:"),function(_2c,_2d,_2e){
with(_2c){
var _2f=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort"),_30=objj_msgSend(_2c,"bounds");
_30.size.height-=1;
_30.size.width-=2;
_30.origin.x+=1;
CGContextBeginPath(_2f);
CGContextMoveToPoint(_2f,CGRectGetMinX(_30),CGRectGetMinY(_30));
CGContextAddLineToPoint(_2f,CGRectGetMaxX(_30),CGRectGetMinY(_30));
CGContextAddLineToPoint(_2f,CGRectGetMidX(_30),CGRectGetMaxY(_30));
CGContextClosePath(_2f);
CGContextSetShadowWithColor(_2f,CGSizeMake(0,1),1.1,_shadowColor||objj_msgSend(CPColor,"whiteColor"));
CGContextSetFillColor(_2f,_color||objj_msgSend(CPColor,"blackColor"));
CGContextFillPath(_2f);
}
})]);
p;26;_CPMenuItemSeparatorView.jt;1124;@STATIC;1.0;I;15;AppKit/CPView.jt;1085;
objj_executeFile("AppKit/CPView.j",NO);
var _1=objj_allocateClassPair(CPView,"_CPMenuItemSeparatorView"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithFrame:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("_CPMenuItemSeparatorView").super_class},"initWithFrame:",_5);
if(_3){
objj_msgSend(_3,"setAutoresizingMask:",CPViewWidthSizable);
}
return _3;
}
}),new objj_method(sel_getUid("drawRect:"),function(_6,_7,_8){
with(_6){
var _9=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort"),_a=objj_msgSend(_6,"bounds");
CGContextBeginPath(_9);
CGContextMoveToPoint(_9,CGRectGetMinX(_a),FLOOR(CGRectGetMidY(_a))-0.5);
CGContextAddLineToPoint(_9,CGRectGetMaxX(_a),FLOOR(CGRectGetMidY(_a))-0.5);
CGContextSetStrokeColor(_9,objj_msgSend(CPColor,"lightGrayColor"));
CGContextStrokePath(_9);
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("view"),function(_b,_c){
with(_b){
return objj_msgSend(objj_msgSend(_b,"alloc"),"initWithFrame:",CGRectMake(0,0,0,10));
}
})]);
p;25;_CPMenuItemStandardView.jt;9238;@STATIC;1.0;t;9219;
var _1=3,_2=14+3,_3=14,_4=17,_5=4,_6=30,_7=10;
var _8=nil,_9=nil,_a=nil,_b=[],_c=[];
var _d=objj_allocateClassPair(CPView,"_CPMenuItemStandardView"),_e=_d.isa;
class_addIvars(_d,[new objj_ivar("_menuItem"),new objj_ivar("_font"),new objj_ivar("_textColor"),new objj_ivar("_textShadowColor"),new objj_ivar("_minSize"),new objj_ivar("_isDirty"),new objj_ivar("_stateView"),new objj_ivar("_imageAndTextView"),new objj_ivar("_keyEquivalentView"),new objj_ivar("_submenuIndicatorView")]);
objj_registerClassPair(_d);
class_addMethods(_d,[new objj_method(sel_getUid("menuItem"),function(_f,_10){
with(_f){
return _menuItem;
}
}),new objj_method(sel_getUid("setMenuItem:"),function(_11,_12,_13){
with(_11){
_menuItem=_13;
}
}),new objj_method(sel_getUid("minSize"),function(_14,_15){
with(_14){
return _minSize;
}
}),new objj_method(sel_getUid("initWithFrame:"),function(_16,_17,_18){
with(_16){
_16=objj_msgSendSuper({receiver:_16,super_class:objj_getClass("_CPMenuItemStandardView").super_class},"initWithFrame:",_18);
if(_16){
_stateView=objj_msgSend(objj_msgSend(CPImageView,"alloc"),"initWithFrame:",CGRectMake(0,0,0,0));
objj_msgSend(_stateView,"setImageScaling:",CPScaleNone);
objj_msgSend(_16,"addSubview:",_stateView);
_imageAndTextView=objj_msgSend(objj_msgSend(_CPImageAndTextView,"alloc"),"initWithFrame:",CGRectMake(0,0,0,0));
objj_msgSend(_imageAndTextView,"setImagePosition:",CPImageLeft);
objj_msgSend(_imageAndTextView,"setTextShadowOffset:",CGSizeMake(0,1));
objj_msgSend(_16,"addSubview:",_imageAndTextView);
_keyEquivalentView=objj_msgSend(objj_msgSend(_CPImageAndTextView,"alloc"),"initWithFrame:",CGRectMake(0,0,0,0));
objj_msgSend(_keyEquivalentView,"setImagePosition:",CPNoImage);
objj_msgSend(_keyEquivalentView,"setTextShadowOffset:",CGSizeMake(0,1));
objj_msgSend(_keyEquivalentView,"setAutoresizingMask:",CPViewMinXMargin);
objj_msgSend(_16,"addSubview:",_keyEquivalentView);
_submenuIndicatorView=objj_msgSend(objj_msgSend(_CPMenuItemSubmenuIndicatorView,"alloc"),"initWithFrame:",CGRectMake(0,0,8,10));
objj_msgSend(_submenuIndicatorView,"setColor:",_8);
objj_msgSend(_submenuIndicatorView,"setAutoresizingMask:",CPViewMinXMargin);
objj_msgSend(_16,"addSubview:",_submenuIndicatorView);
objj_msgSend(_16,"setAutoresizingMask:",CPViewWidthSizable);
}
return _16;
}
}),new objj_method(sel_getUid("textColor"),function(_19,_1a){
with(_19){
if(!objj_msgSend(_menuItem,"isEnabled")){
return objj_msgSend(CPColor,"lightGrayColor");
}
return _textColor||objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",70/255,69/255,69/255,1);
}
}),new objj_method(sel_getUid("textShadowColor"),function(_1b,_1c){
with(_1b){
if(!objj_msgSend(_menuItem,"isEnabled")){
return nil;
}
return _textShadowColor||objj_msgSend(CPColor,"colorWithWhite:alpha:",1,0.8);
}
}),new objj_method(sel_getUid("setFont:"),function(_1d,_1e,_1f){
with(_1d){
_font=_1f;
}
}),new objj_method(sel_getUid("update"),function(_20,_21){
with(_20){
var x=_1+objj_msgSend(_menuItem,"indentationLevel")*_4,_22=0,_23=objj_msgSend(objj_msgSend(_menuItem,"menu"),"showsStateColumn");
if(_23){
objj_msgSend(_stateView,"setHidden:",NO);
objj_msgSend(_stateView,"setImage:",_b[objj_msgSend(_menuItem,"state")]||nil);
x+=_3;
}else{
objj_msgSend(_stateView,"setHidden:",YES);
}
objj_msgSend(_imageAndTextView,"setFont:",objj_msgSend(_menuItem,"font")||_font);
objj_msgSend(_imageAndTextView,"setVerticalAlignment:",CPCenterVerticalTextAlignment);
objj_msgSend(_imageAndTextView,"setImage:",objj_msgSend(_menuItem,"image"));
objj_msgSend(_imageAndTextView,"setText:",objj_msgSend(_menuItem,"title"));
objj_msgSend(_imageAndTextView,"setTextColor:",objj_msgSend(_20,"textColor"));
objj_msgSend(_imageAndTextView,"setTextShadowColor:",objj_msgSend(_20,"textShadowColor"));
objj_msgSend(_imageAndTextView,"setTextShadowOffset:",CGSizeMake(0,1));
objj_msgSend(_imageAndTextView,"sizeToFit");
var _24=objj_msgSend(_imageAndTextView,"frame");
_24.origin.x=x;
x+=CGRectGetWidth(_24);
_22=MAX(_22,CGRectGetHeight(_24));
var _25=!!objj_msgSend(_menuItem,"keyEquivalent"),_26=objj_msgSend(_menuItem,"hasSubmenu");
if(_25||_26){
x+=_6;
}
if(_25){
objj_msgSend(_keyEquivalentView,"setFont:",objj_msgSend(_menuItem,"font")||_font);
objj_msgSend(_keyEquivalentView,"setVerticalAlignment:",CPCenterVerticalTextAlignment);
objj_msgSend(_keyEquivalentView,"setImage:",objj_msgSend(_menuItem,"image"));
objj_msgSend(_keyEquivalentView,"setText:",objj_msgSend(_menuItem,"keyEquivalentStringRepresentation"));
objj_msgSend(_keyEquivalentView,"setTextColor:",objj_msgSend(_20,"textColor"));
objj_msgSend(_keyEquivalentView,"setTextShadowColor:",objj_msgSend(_20,"textShadowColor"));
objj_msgSend(_keyEquivalentView,"setTextShadowOffset:",CGSizeMake(0,1));
objj_msgSend(_keyEquivalentView,"setFrameOrigin:",CGPointMake(x,_5));
objj_msgSend(_keyEquivalentView,"sizeToFit");
var _27=objj_msgSend(_keyEquivalentView,"frame");
_27.origin.x=x;
x+=CGRectGetWidth(_27);
_22=MAX(_22,CGRectGetHeight(_27));
if(_26){
x+=_6;
}
}else{
objj_msgSend(_keyEquivalentView,"setHidden:",YES);
}
if(_26){
objj_msgSend(_submenuIndicatorView,"setHidden:",NO);
var _28=objj_msgSend(_submenuIndicatorView,"frame");
_28.origin.x=x;
x+=CGRectGetWidth(_28);
_22=MAX(_22,CGRectGetHeight(_28));
}else{
objj_msgSend(_submenuIndicatorView,"setHidden:",YES);
}
_22+=2*_5;
_24.origin.y=FLOOR((_22-CGRectGetHeight(_24))/2);
objj_msgSend(_imageAndTextView,"setFrame:",_24);
if(_23){
objj_msgSend(_stateView,"setFrameSize:",CGSizeMake(_3,_22));
}
if(_25){
_27.origin.y=FLOOR((_22-CGRectGetHeight(_27))/2);
objj_msgSend(_keyEquivalentView,"setFrame:",_27);
}
if(_26){
_28.origin.y=FLOOR((_22-CGRectGetHeight(_28))/2);
objj_msgSend(_submenuIndicatorView,"setFrame:",_28);
}
_minSize=CGSizeMake(x+_2,_22);
objj_msgSend(_20,"setAutoresizesSubviews:",NO);
objj_msgSend(_20,"setFrameSize:",_minSize);
objj_msgSend(_20,"setAutoresizesSubviews:",YES);
}
}),new objj_method(sel_getUid("highlight:"),function(_29,_2a,_2b){
with(_29){
if(!objj_msgSend(_menuItem,"isEnabled")){
return;
}
if(_2b){
objj_msgSend(_29,"setBackgroundColor:",_9);
objj_msgSend(_imageAndTextView,"setImage:",objj_msgSend(_menuItem,"alternateImage")||objj_msgSend(_menuItem,"image"));
objj_msgSend(_imageAndTextView,"setTextColor:",objj_msgSend(CPColor,"whiteColor"));
objj_msgSend(_keyEquivalentView,"setTextColor:",objj_msgSend(CPColor,"whiteColor"));
objj_msgSend(_submenuIndicatorView,"setColor:",objj_msgSend(CPColor,"whiteColor"));
objj_msgSend(_imageAndTextView,"setTextShadowColor:",_a);
objj_msgSend(_keyEquivalentView,"setTextShadowColor:",_a);
}else{
objj_msgSend(_29,"setBackgroundColor:",nil);
objj_msgSend(_imageAndTextView,"setImage:",objj_msgSend(_menuItem,"image"));
objj_msgSend(_imageAndTextView,"setTextColor:",objj_msgSend(_29,"textColor"));
objj_msgSend(_keyEquivalentView,"setTextColor:",objj_msgSend(_29,"textColor"));
objj_msgSend(_submenuIndicatorView,"setColor:",_8);
objj_msgSend(_imageAndTextView,"setTextShadowColor:",objj_msgSend(_29,"textShadowColor"));
objj_msgSend(_keyEquivalentView,"setTextShadowColor:",objj_msgSend(_29,"textShadowColor"));
}
if(_2b){
objj_msgSend(_stateView,"setImage:",_c[objj_msgSend(_menuItem,"state")]||nil);
}else{
objj_msgSend(_stateView,"setImage:",_b[objj_msgSend(_menuItem,"state")]||nil);
}
}
})]);
class_addMethods(_e,[new objj_method(sel_getUid("initialize"),function(_2c,_2d){
with(_2c){
if(_2c!==objj_msgSend(_CPMenuItemStandardView,"class")){
return;
}
_8=objj_msgSend(CPColor,"grayColor");
_9=objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",95/255,131/255,185/255,1);
_a=objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",26/255,73/255,109/255,1);
var _2e=objj_msgSend(CPBundle,"bundleForClass:",_2c);
_b[CPOffState]=nil;
_c[CPOffState]=nil;
_b[CPOnState]=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_2e,"pathForResource:","CPMenuItem/CPMenuItemOnState.png"),CGSizeMake(14,14));
_c[CPOnState]=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_2e,"pathForResource:","CPMenuItem/CPMenuItemOnStateHighlighted.png"),CGSizeMake(14,14));
_b[CPMixedState]=nil;
_c[CPMixedState]=nil;
}
}),new objj_method(sel_getUid("view"),function(_2f,_30){
with(_2f){
return objj_msgSend(objj_msgSend(_2f,"alloc"),"init");
}
}),new objj_method(sel_getUid("_standardLeftMargin"),function(_31,_32){
with(_31){
return _1+_3;
}
})]);
var _d=objj_allocateClassPair(CPView,"_CPMenuItemSubmenuIndicatorView"),_e=_d.isa;
class_addIvars(_d,[new objj_ivar("_color")]);
objj_registerClassPair(_d);
class_addMethods(_d,[new objj_method(sel_getUid("setColor:"),function(_33,_34,_35){
with(_33){
if(_color===_35){
return;
}
_color=_35;
objj_msgSend(_33,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("drawRect:"),function(_36,_37,_38){
with(_36){
var _39=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort"),_3a=objj_msgSend(_36,"bounds");
CGContextBeginPath(_39);
CGContextMoveToPoint(_39,CGRectGetMinX(_3a),CGRectGetMinY(_3a));
CGContextAddLineToPoint(_39,CGRectGetMaxX(_3a),CGRectGetMidY(_3a));
CGContextAddLineToPoint(_39,CGRectGetMinX(_3a),CGRectGetMaxY(_3a));
CGContextClosePath(_39);
CGContextSetFillColor(_39,_color);
CGContextFillPath(_39);
}
})]);
p;17;_CPMenuItemView.jt;6328;@STATIC;1.0;i;26;_CPMenuItemSeparatorView.ji;25;_CPMenuItemStandardView.ji;24;_CPMenuItemMenuBarView.jt;6219;
objj_executeFile("_CPMenuItemSeparatorView.j",YES);
objj_executeFile("_CPMenuItemStandardView.j",YES);
objj_executeFile("_CPMenuItemMenuBarView.j",YES);
var _1=3,_2=16,_3=14,_4=17,_5=4;
var _6=nil,_7=nil,_8=[],_9=[];
var _a=objj_allocateClassPair(CPView,"_CPMenuItemView"),_b=_a.isa;
class_addIvars(_a,[new objj_ivar("_menuItem"),new objj_ivar("_view"),new objj_ivar("_font"),new objj_ivar("_textColor"),new objj_ivar("_textShadowColor"),new objj_ivar("_minSize"),new objj_ivar("_isDirty"),new objj_ivar("_showsStateColumn"),new objj_ivar("_stateView"),new objj_ivar("_imageAndTextView"),new objj_ivar("_submenuView")]);
objj_registerClassPair(_a);
class_addMethods(_a,[new objj_method(sel_getUid("initWithFrame:forMenuItem:"),function(_c,_d,_e,_f){
with(_c){
_c=objj_msgSendSuper({receiver:_c,super_class:objj_getClass("_CPMenuItemView").super_class},"initWithFrame:",_e);
if(_c){
_menuItem=_f;
_showsStateColumn=YES;
_isDirty=YES;
objj_msgSend(_c,"setAutoresizingMask:",CPViewWidthSizable);
objj_msgSend(_c,"synchronizeWithMenuItem");
}
return _c;
}
}),new objj_method(sel_getUid("minSize"),function(_10,_11){
with(_10){
return _minSize;
}
}),new objj_method(sel_getUid("setDirty"),function(_12,_13){
with(_12){
_isDirty=YES;
}
}),new objj_method(sel_getUid("synchronizeWithMenuItem"),function(_14,_15){
with(_14){
var _16=objj_msgSend(_menuItem,"view");
if(objj_msgSend(_menuItem,"isSeparatorItem")){
if(!objj_msgSend(_view,"isKindOfClass:",objj_msgSend(_CPMenuItemSeparatorView,"class"))){
objj_msgSend(_view,"removeFromSuperview");
_view=objj_msgSend(_CPMenuItemSeparatorView,"view");
}
}else{
if(_16){
if(_view!==_16){
objj_msgSend(_view,"removeFromSuperview");
_view=_16;
}
}else{
if(objj_msgSend(_menuItem,"menu")==objj_msgSend(CPApp,"mainMenu")){
if(!objj_msgSend(_view,"isKindOfClass:",objj_msgSend(_CPMenuItemMenuBarView,"class"))){
objj_msgSend(_view,"removeFromSuperview");
_view=objj_msgSend(_CPMenuItemMenuBarView,"view");
}
objj_msgSend(_view,"setMenuItem:",_menuItem);
}else{
if(!objj_msgSend(_view,"isKindOfClass:",objj_msgSend(_CPMenuItemStandardView,"class"))){
objj_msgSend(_view,"removeFromSuperview");
_view=objj_msgSend(_CPMenuItemStandardView,"view");
}
objj_msgSend(_view,"setMenuItem:",_menuItem);
}
}
}
if(objj_msgSend(_view,"superview")!==_14){
objj_msgSend(_14,"addSubview:",_view);
}
if(objj_msgSend(_view,"respondsToSelector:",sel_getUid("update"))){
objj_msgSend(_view,"update");
}
_minSize=objj_msgSend(_view,"frame").size;
objj_msgSend(_14,"setAutoresizesSubviews:",NO);
objj_msgSend(_14,"setFrameSize:",_minSize);
objj_msgSend(_14,"setAutoresizesSubviews:",YES);
}
}),new objj_method(sel_getUid("setShowsStateColumn:"),function(_17,_18,_19){
with(_17){
_showsStateColumn=_19;
}
}),new objj_method(sel_getUid("highlight:"),function(_1a,_1b,_1c){
with(_1a){
if(objj_msgSend(_view,"respondsToSelector:",sel_getUid("highlight:"))){
objj_msgSend(_view,"highlight:",_1c);
}
}
}),new objj_method(sel_getUid("eventOnSubmenu:"),function(_1d,_1e,_1f){
with(_1d){
if(!objj_msgSend(_menuItem,"hasSubmenu")){
return NO;
}
return CGRectContainsPoint(objj_msgSend(_submenuView,"frame"),objj_msgSend(_1d,"convertPoint:fromView:",objj_msgSend(_1f,"locationInWindow"),nil));
}
}),new objj_method(sel_getUid("isHidden"),function(_20,_21){
with(_20){
return objj_msgSend(_menuItem,"isHidden");
}
}),new objj_method(sel_getUid("menuItem"),function(_22,_23){
with(_22){
return _menuItem;
}
}),new objj_method(sel_getUid("setFont:"),function(_24,_25,_26){
with(_24){
if(_font===_26){
return;
}
_font=_26;
if(objj_msgSend(_view,"respondsToSelector:",sel_getUid("setFont:"))){
objj_msgSend(_view,"setFont:",_26);
}
objj_msgSend(_24,"setDirty");
}
}),new objj_method(sel_getUid("setTextColor:"),function(_27,_28,_29){
with(_27){
if(_textColor==_29){
return;
}
_textColor=_29;
objj_msgSend(_imageAndTextView,"setTextColor:",objj_msgSend(_27,"textColor"));
objj_msgSend(_submenuView,"setColor:",objj_msgSend(_27,"textColor"));
}
}),new objj_method(sel_getUid("textColor"),function(_2a,_2b){
with(_2a){
return nil;
}
}),new objj_method(sel_getUid("setTextShadowColor:"),function(_2c,_2d,_2e){
with(_2c){
if(_textShadowColor==_2e){
return;
}
_textShadowColor=_2e;
objj_msgSend(_imageAndTextView,"setTextShadowColor:",objj_msgSend(_2c,"textShadowColor"));
}
}),new objj_method(sel_getUid("textShadowColor"),function(_2f,_30){
with(_2f){
return objj_msgSend(_menuItem,"isEnabled")?(_textShadowColor?_textShadowColor:objj_msgSend(CPColor,"colorWithWhite:alpha:",1,0.8)):objj_msgSend(CPColor,"colorWithWhite:alpha:",0.8,0.8);
}
})]);
class_addMethods(_b,[new objj_method(sel_getUid("initialize"),function(_31,_32){
with(_31){
if(_31!=objj_msgSend(_CPMenuItemView,"class")){
return;
}
_6=objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",95/255,131/255,185/255,1);
_7=objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",26/255,73/255,109/255,1);
var _33=objj_msgSend(CPBundle,"bundleForClass:",_31);
_8[CPOffState]=nil;
_9[CPOffState]=nil;
_8[CPOnState]=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_33,"pathForResource:","CPMenuItem/CPMenuItemOnState.png"),CGSizeMake(14,14));
_9[CPOnState]=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_33,"pathForResource:","CPMenuItem/CPMenuItemOnStateHighlighted.png"),CGSizeMake(14,14));
_8[CPMixedState]=nil;
_9[CPMixedState]=nil;
}
}),new objj_method(sel_getUid("leftMargin"),function(_34,_35){
with(_34){
return _1+_3;
}
})]);
var _a=objj_allocateClassPair(CPView,"_CPMenuItemArrowView"),_b=_a.isa;
class_addIvars(_a,[new objj_ivar("_color")]);
objj_registerClassPair(_a);
class_addMethods(_a,[new objj_method(sel_getUid("setColor:"),function(_36,_37,_38){
with(_36){
if(_color==_38){
return;
}
_color=_38;
objj_msgSend(_36,"setNeedsDisplay:",YES);
}
}),new objj_method(sel_getUid("drawRect:"),function(_39,_3a,_3b){
with(_39){
var _3c=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort");
CGContextBeginPath(_3c);
CGContextMoveToPoint(_3c,1,4);
CGContextAddLineToPoint(_3c,9,4);
CGContextAddLineToPoint(_3c,5,8);
CGContextAddLineToPoint(_3c,1,4);
CGContextClosePath(_3c);
CGContextSetFillColor(_3c,_color);
CGContextFillPath(_3c);
}
})]);
p;12;CPMenuItem.jt;15128;@STATIC;1.0;I;20;Foundation/CPCoder.jI;21;Foundation/CPObject.jI;21;Foundation/CPString.ji;9;CPImage.ji;8;CPMenu.ji;8;CPView.ji;17;_CPMenuItemView.jt;14972;
objj_executeFile("Foundation/CPCoder.j",NO);
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("Foundation/CPString.j",NO);
objj_executeFile("CPImage.j",YES);
objj_executeFile("CPMenu.j",YES);
objj_executeFile("CPView.j",YES);
objj_executeFile("_CPMenuItemView.j",YES);
var _1=objj_allocateClassPair(CPObject,"CPMenuItem"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_isSeparator"),new objj_ivar("_title"),new objj_ivar("_font"),new objj_ivar("_target"),new objj_ivar("_action"),new objj_ivar("_isEnabled"),new objj_ivar("_isHidden"),new objj_ivar("_tag"),new objj_ivar("_state"),new objj_ivar("_image"),new objj_ivar("_alternateImage"),new objj_ivar("_onStateImage"),new objj_ivar("_offStateImage"),new objj_ivar("_mixedStateImage"),new objj_ivar("_submenu"),new objj_ivar("_menu"),new objj_ivar("_keyEquivalent"),new objj_ivar("_keyEquivalentModifierMask"),new objj_ivar("_mnemonicLocation"),new objj_ivar("_isAlternate"),new objj_ivar("_indentationLevel"),new objj_ivar("_toolTip"),new objj_ivar("_representedObject"),new objj_ivar("_view"),new objj_ivar("_menuItemView")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("init"),function(_3,_4){
with(_3){
return objj_msgSend(_3,"initWithTitle:action:keyEquivalent:","",nil,nil);
}
}),new objj_method(sel_getUid("initWithTitle:action:keyEquivalent:"),function(_5,_6,_7,_8,_9){
with(_5){
_5=objj_msgSendSuper({receiver:_5,super_class:objj_getClass("CPMenuItem").super_class},"init");
if(_5){
_isSeparator=NO;
_title=_7;
_action=_8;
_isEnabled=YES;
_tag=0;
_state=CPOffState;
_keyEquivalent=_9||"";
_keyEquivalentModifierMask=CPPlatformActionKeyMask;
_indentationLevel=0;
_mnemonicLocation=CPNotFound;
}
return _5;
}
}),new objj_method(sel_getUid("setEnabled:"),function(_a,_b,_c){
with(_a){
if(objj_msgSend(_menu,"autoenablesItems")){
return;
}
_isEnabled=_c;
objj_msgSend(_menuItemView,"setDirty");
objj_msgSend(_menu,"itemChanged:",_a);
}
}),new objj_method(sel_getUid("isEnabled"),function(_d,_e){
with(_d){
return _isEnabled;
}
}),new objj_method(sel_getUid("setHidden:"),function(_f,_10,_11){
with(_f){
if(_isHidden==_11){
return;
}
_isHidden=_11;
objj_msgSend(_menu,"itemChanged:",_f);
}
}),new objj_method(sel_getUid("isHidden"),function(_12,_13){
with(_12){
return _isHidden;
}
}),new objj_method(sel_getUid("isHiddenOrHasHiddenAncestor"),function(_14,_15){
with(_14){
if(_isHidden){
return YES;
}
var _16=objj_msgSend(_menu,"supermenu");
if(objj_msgSend(objj_msgSend(_16,"itemAtIndex:",objj_msgSend(_16,"indexOfItemWithSubmenu:",_menu)),"isHiddenOrHasHiddenAncestor")){
return YES;
}
return NO;
}
}),new objj_method(sel_getUid("setTarget:"),function(_17,_18,_19){
with(_17){
_target=_19;
}
}),new objj_method(sel_getUid("target"),function(_1a,_1b){
with(_1a){
return _target;
}
}),new objj_method(sel_getUid("setAction:"),function(_1c,_1d,_1e){
with(_1c){
_action=_1e;
}
}),new objj_method(sel_getUid("action"),function(_1f,_20){
with(_1f){
return _action;
}
}),new objj_method(sel_getUid("setTitle:"),function(_21,_22,_23){
with(_21){
_mnemonicLocation=CPNotFound;
if(_title==_23){
return;
}
_title=_23;
objj_msgSend(_menuItemView,"setDirty");
objj_msgSend(_menu,"itemChanged:",_21);
}
}),new objj_method(sel_getUid("title"),function(_24,_25){
with(_24){
return _title;
}
}),new objj_method(sel_getUid("setTextColor:"),function(_26,_27,_28){
with(_26){
}
}),new objj_method(sel_getUid("setFont:"),function(_29,_2a,_2b){
with(_29){
if(_font==_2b){
return;
}
_font=_2b;
objj_msgSend(_menu,"itemChanged:",_29);
objj_msgSend(_menuItemView,"setDirty");
}
}),new objj_method(sel_getUid("font"),function(_2c,_2d){
with(_2c){
return _font;
}
}),new objj_method(sel_getUid("setTag:"),function(_2e,_2f,_30){
with(_2e){
_tag=_30;
}
}),new objj_method(sel_getUid("tag"),function(_31,_32){
with(_31){
return _tag;
}
}),new objj_method(sel_getUid("setState:"),function(_33,_34,_35){
with(_33){
if(_state==_35){
return;
}
_state=_35;
objj_msgSend(_menu,"itemChanged:",_33);
objj_msgSend(_menuItemView,"setDirty");
}
}),new objj_method(sel_getUid("state"),function(_36,_37){
with(_36){
return _state;
}
}),new objj_method(sel_getUid("setImage:"),function(_38,_39,_3a){
with(_38){
if(_image==_3a){
return;
}
_image=_3a;
objj_msgSend(_menuItemView,"setDirty");
objj_msgSend(_menu,"itemChanged:",_38);
}
}),new objj_method(sel_getUid("image"),function(_3b,_3c){
with(_3b){
return _image;
}
}),new objj_method(sel_getUid("setAlternateImage:"),function(_3d,_3e,_3f){
with(_3d){
_alternateImage=_3f;
}
}),new objj_method(sel_getUid("alternateImage"),function(_40,_41){
with(_40){
return _alternateImage;
}
}),new objj_method(sel_getUid("setOnStateImage:"),function(_42,_43,_44){
with(_42){
if(_onStateImage==_44){
return;
}
_onStateImage=_44;
objj_msgSend(_menu,"itemChanged:",_42);
}
}),new objj_method(sel_getUid("onStateImage"),function(_45,_46){
with(_45){
return _onStateImage;
}
}),new objj_method(sel_getUid("setOffStateImage:"),function(_47,_48,_49){
with(_47){
if(_offStateImage==_49){
return;
}
_offStateImage=_49;
objj_msgSend(_menu,"itemChanged:",_47);
}
}),new objj_method(sel_getUid("offStateImage"),function(_4a,_4b){
with(_4a){
return _offStateImage;
}
}),new objj_method(sel_getUid("setMixedStateImage:"),function(_4c,_4d,_4e){
with(_4c){
if(_mixedStateImage==_4e){
return;
}
_mixedStateImage=_4e;
objj_msgSend(_menu,"itemChanged:",_4c);
}
}),new objj_method(sel_getUid("mixedStateImage"),function(_4f,_50){
with(_4f){
return _mixedStateImage;
}
}),new objj_method(sel_getUid("setSubmenu:"),function(_51,_52,_53){
with(_51){
if(_submenu===_53){
return;
}
var _54=objj_msgSend(_submenu,"supermenu");
if(_54){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"Can't add submenu \""+objj_msgSend(_53,"title")+"\" to item \""+objj_msgSend(_51,"title")+"\", because it is already submenu of \""+objj_msgSend(objj_msgSend(_53,"supermenu"),"title")+"\"");
}
_submenu=_53;
if(_submenu){
objj_msgSend(_submenu,"setSupermenu:",_menu);
objj_msgSend(_51,"setTarget:",_menu);
objj_msgSend(_51,"setAction:",sel_getUid("submenuAction:"));
}else{
objj_msgSend(_51,"setTarget:",nil);
objj_msgSend(_51,"setAction:",NULL);
}
objj_msgSend(_menuItemView,"setDirty");
objj_msgSend(_menu,"itemChanged:",_51);
}
}),new objj_method(sel_getUid("submenu"),function(_55,_56){
with(_55){
return _submenu;
}
}),new objj_method(sel_getUid("hasSubmenu"),function(_57,_58){
with(_57){
return _submenu?YES:NO;
}
}),new objj_method(sel_getUid("isSeparatorItem"),function(_59,_5a){
with(_59){
return _isSeparator;
}
}),new objj_method(sel_getUid("setMenu:"),function(_5b,_5c,_5d){
with(_5b){
_menu=_5d;
}
}),new objj_method(sel_getUid("menu"),function(_5e,_5f){
with(_5e){
return _menu;
}
}),new objj_method(sel_getUid("setKeyEquivalent:"),function(_60,_61,_62){
with(_60){
_keyEquivalent=_62||"";
}
}),new objj_method(sel_getUid("keyEquivalent"),function(_63,_64){
with(_63){
return _keyEquivalent;
}
}),new objj_method(sel_getUid("setKeyEquivalentModifierMask:"),function(_65,_66,_67){
with(_65){
_keyEquivalentModifierMask=_67;
}
}),new objj_method(sel_getUid("keyEquivalentModifierMask"),function(_68,_69){
with(_68){
return _keyEquivalentModifierMask;
}
}),new objj_method(sel_getUid("keyEquivalentStringRepresentation"),function(_6a,_6b){
with(_6a){
if(!objj_msgSend(_keyEquivalent,"length")){
return "";
}
var _6c=_keyEquivalent.toUpperCase(),_6d=_keyEquivalentModifierMask&CPShiftKeyMask||_6c===_keyEquivalent;
if(CPBrowserIsOperatingSystem(CPMacOperatingSystem)){
if(_keyEquivalentModifierMask&CPCommandKeyMask){
_6c="⌘"+_6c;
}
if(_6d){
_6c="⇧"+_6c;
}
if(_keyEquivalentModifierMask&CPAlternateKeyMask){
_6c="⌥"+_6c;
}
if(_keyEquivalentModifierMask&CPControlKeyMask){
_6c="^"+_6c;
}
}else{
if(_6d){
_6c="Shift-"+_6c;
}
if(_keyEquivalentModifierMask&CPAlternateKeyMask){
_6c="Alt-"+_6c;
}
if(_keyEquivalentModifierMask&CPControlKeyMask||_keyEquivalentModifierMask&CPCommandKeyMask){
_6c="Ctrl-"+_6c;
}
}
return _6c;
}
}),new objj_method(sel_getUid("setMnemonicLocation:"),function(_6e,_6f,_70){
with(_6e){
_mnemonicLocation=_70;
}
}),new objj_method(sel_getUid("mnemonicLocation"),function(_71,_72){
with(_71){
return _mnemonicLocation;
}
}),new objj_method(sel_getUid("setTitleWithMnemonicLocation:"),function(_73,_74,_75){
with(_73){
var _76=objj_msgSend(_75,"rangeOfString:","&").location;
if(_76==CPNotFound){
objj_msgSend(_73,"setTitle:",_75);
}else{
objj_msgSend(_73,"setTitle:",objj_msgSend(_75,"substringToIndex:",_76)+objj_msgSend(_75,"substringFromIndex:",_76+1));
objj_msgSend(_73,"setMnemonicLocation:",_76);
}
}
}),new objj_method(sel_getUid("mnemonic"),function(_77,_78){
with(_77){
return _mnemonicLocation==CPNotFound?"":objj_msgSend(_title,"characterAtIndex:",_mnemonicLocation);
}
}),new objj_method(sel_getUid("setAlternate:"),function(_79,_7a,_7b){
with(_79){
_isAlternate=_7b;
}
}),new objj_method(sel_getUid("isAlternate"),function(_7c,_7d){
with(_7c){
return _isAlternate;
}
}),new objj_method(sel_getUid("setIndentationLevel:"),function(_7e,_7f,_80){
with(_7e){
if(_80<0){
objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"setIndentationLevel: argument must be greater than or equal to 0.");
}
_indentationLevel=MIN(15,_80);
}
}),new objj_method(sel_getUid("indentationLevel"),function(_81,_82){
with(_81){
return _indentationLevel;
}
}),new objj_method(sel_getUid("setToolTip:"),function(_83,_84,_85){
with(_83){
_toolTip=_85;
}
}),new objj_method(sel_getUid("toolTip"),function(_86,_87){
with(_86){
return _toolTip;
}
}),new objj_method(sel_getUid("setRepresentedObject:"),function(_88,_89,_8a){
with(_88){
_representedObject=_8a;
}
}),new objj_method(sel_getUid("representedObject"),function(_8b,_8c){
with(_8b){
return _representedObject;
}
}),new objj_method(sel_getUid("setView:"),function(_8d,_8e,_8f){
with(_8d){
if(_view===_8f){
return;
}
_view=_8f;
objj_msgSend(_menuItemView,"setDirty");
objj_msgSend(_menu,"itemChanged:",_8d);
}
}),new objj_method(sel_getUid("view"),function(_90,_91){
with(_90){
return _view;
}
}),new objj_method(sel_getUid("isHighlighted"),function(_92,_93){
with(_92){
return objj_msgSend(objj_msgSend(_92,"menu"),"highlightedItem")==_92;
}
}),new objj_method(sel_getUid("_menuItemView"),function(_94,_95){
with(_94){
if(!_menuItemView){
_menuItemView=objj_msgSend(objj_msgSend(_CPMenuItemView,"alloc"),"initWithFrame:forMenuItem:",CGRectMakeZero(),_94);
}
return _menuItemView;
}
}),new objj_method(sel_getUid("_isSelectable"),function(_96,_97){
with(_96){
return !objj_msgSend(_96,"submenu")||objj_msgSend(_96,"action")!==sel_getUid("submenuAction:")||objj_msgSend(_96,"target")!==objj_msgSend(_96,"menu");
}
}),new objj_method(sel_getUid("_isMenuBarButton"),function(_98,_99){
with(_98){
return !objj_msgSend(_98,"submenu")&&objj_msgSend(_98,"menu")===objj_msgSend(CPApp,"mainMenu");
}
})]);
class_addMethods(_2,[new objj_method(sel_getUid("separatorItem"),function(_9a,_9b){
with(_9a){
var _9c=objj_msgSend(objj_msgSend(_9a,"alloc"),"initWithTitle:action:keyEquivalent:","",nil,nil);
_9c._isSeparator=YES;
return _9c;
}
})]);
var _9d="CPMenuItemIsSeparatorKey",_9e="CPMenuItemTitleKey",_9f="CPMenuItemTargetKey",_a0="CPMenuItemActionKey",_a1="CPMenuItemIsEnabledKey",_a2="CPMenuItemIsHiddenKey",_a3="CPMenuItemTagKey",_a4="CPMenuItemStateKey",_a5="CPMenuItemImageKey",_a6="CPMenuItemAlternateImageKey",_a7="CPMenuItemSubmenuKey",_a8="CPMenuItemMenuKey",_a9="CPMenuItemKeyEquivalentKey",_aa="CPMenuItemKeyEquivalentModifierMaskKey",_ab="CPMenuItemIndentationLevelKey",_ac="CPMenuItemRepresentedObjectKey",_ad="CPMenuItemViewKey";
var _1=objj_getClass("CPMenuItem");
if(!_1){
throw new SyntaxError("*** Could not find definition for class \"CPMenuItem\"");
}
var _2=_1.isa;
class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_ae,_af,_b0){
with(_ae){
_ae=objj_msgSendSuper({receiver:_ae,super_class:objj_getClass("CPMenuItem").super_class},"init");
if(_ae){
_isSeparator=objj_msgSend(_b0,"containsValueForKey:",_9d)&&objj_msgSend(_b0,"decodeBoolForKey:",_9d);
_title=objj_msgSend(_b0,"decodeObjectForKey:",_9e);
_target=objj_msgSend(_b0,"decodeObjectForKey:",_9f);
_action=objj_msgSend(_b0,"decodeObjectForKey:",_a0);
_isEnabled=objj_msgSend(_b0,"containsValueForKey:",(_a1))?objj_msgSend(_b0,"decodeObjectForKey:",(_a1)):(YES);
_isHidden=objj_msgSend(_b0,"containsValueForKey:",(_a2))?objj_msgSend(_b0,"decodeObjectForKey:",(_a2)):(NO);
_tag=objj_msgSend(_b0,"containsValueForKey:",(_a3))?objj_msgSend(_b0,"decodeObjectForKey:",(_a3)):(0);
_state=objj_msgSend(_b0,"containsValueForKey:",(_a4))?objj_msgSend(_b0,"decodeObjectForKey:",(_a4)):(CPOffState);
_image=objj_msgSend(_b0,"containsValueForKey:",(_a5))?objj_msgSend(_b0,"decodeObjectForKey:",(_a5)):(nil);
_alternateImage=objj_msgSend(_b0,"containsValueForKey:",(_a6))?objj_msgSend(_b0,"decodeObjectForKey:",(_a6)):(nil);
_menu=objj_msgSend(_b0,"containsValueForKey:",(_a8))?objj_msgSend(_b0,"decodeObjectForKey:",(_a8)):(nil);
objj_msgSend(_ae,"setSubmenu:",objj_msgSend(_b0,"containsValueForKey:",(_a7))?objj_msgSend(_b0,"decodeObjectForKey:",(_a7)):(nil));
_keyEquivalent=objj_msgSend(_b0,"decodeObjectForKey:",_a9)||"";
_keyEquivalentModifierMask=objj_msgSend(_b0,"decodeObjectForKey:",_aa)||0;
objj_msgSend(_ae,"setIndentationLevel:",objj_msgSend(_b0,"decodeIntForKey:",_ab)||0);
_representedObject=objj_msgSend(_b0,"containsValueForKey:",(_ac))?objj_msgSend(_b0,"decodeObjectForKey:",(_ac)):(nil);
_view=objj_msgSend(_b0,"containsValueForKey:",(_ad))?objj_msgSend(_b0,"decodeObjectForKey:",(_ad)):(nil);
}
return _ae;
}
}),new objj_method(sel_getUid("encodeWithCoder:"),function(_b1,_b2,_b3){
with(_b1){
if(_isSeparator){
objj_msgSend(_b3,"encodeBool:forKey:",_isSeparator,_9d);
}
objj_msgSend(_b3,"encodeObject:forKey:",_title,_9e);
objj_msgSend(_b3,"encodeObject:forKey:",_target,_9f);
objj_msgSend(_b3,"encodeObject:forKey:",_action,_a0);
if((_isEnabled)!==(YES)){
objj_msgSend(_b3,"encodeObject:forKey:",(_isEnabled),(_a1));
}
if((_isHidden)!==(NO)){
objj_msgSend(_b3,"encodeObject:forKey:",(_isHidden),(_a2));
}
if((_tag)!==(0)){
objj_msgSend(_b3,"encodeObject:forKey:",(_tag),(_a3));
}
if((_state)!==(CPOffState)){
objj_msgSend(_b3,"encodeObject:forKey:",(_state),(_a4));
}
if((_image)!==(nil)){
objj_msgSend(_b3,"encodeObject:forKey:",(_image),(_a5));
}
if((_alternateImage)!==(nil)){
objj_msgSend(_b3,"encodeObject:forKey:",(_alternateImage),(_a6));
}
if((_submenu)!==(nil)){
objj_msgSend(_b3,"encodeObject:forKey:",(_submenu),(_a7));
}
if((_menu)!==(nil)){
objj_msgSend(_b3,"encodeObject:forKey:",(_menu),(_a8));
}
if(_keyEquivalent&&_keyEquivalent.length){
objj_msgSend(_b3,"encodeObject:forKey:",_keyEquivalent,_a9);
}
if(_keyEquivalentModifierMask){
objj_msgSend(_b3,"encodeObject:forKey:",_keyEquivalentModifierMask,_aa);
}
if(_indentationLevel>0){
objj_msgSend(_b3,"encodeInt:forKey:",_indentationLevel,_ab);
}
if((_representedObject)!==(nil)){
objj_msgSend(_b3,"encodeObject:forKey:",(_representedObject),(_ac));
}
if((_view)!==(nil)){
objj_msgSend(_b3,"encodeObject:forKey:",(_view),(_ad));
}
}
})]);
p;31;_CPBorderlessBridgeWindowView.jt;2040;@STATIC;1.0;i;15;_CPWindowView.jt;2001;
objj_executeFile("_CPWindowView.j",YES);
var _1=nil;
var _2=objj_allocateClassPair(_CPWindowView,"_CPBorderlessBridgeWindowView"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_toolbarBackgroundView")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("setShowsResizeIndicator:"),function(_4,_5,_6){
with(_4){
}
}),new objj_method(sel_getUid("tile"),function(_7,_8){
with(_7){
objj_msgSendSuper({receiver:_7,super_class:objj_getClass("_CPBorderlessBridgeWindowView").super_class},"tile");
var _9=objj_msgSend(_7,"window"),_a=objj_msgSend(_7,"bounds");
objj_msgSend(objj_msgSend(_9,"contentView"),"setFrame:",CGRectMake(0,objj_msgSend(_7,"toolbarMaxY"),CGRectGetWidth(_a),CGRectGetHeight(_a)-objj_msgSend(_7,"toolbarMaxY")));
if(!objj_msgSend(objj_msgSend(_9,"toolbar"),"isVisible")){
objj_msgSend(_toolbarBackgroundView,"removeFromSuperview");
_toolbarBackgroundView=nil;
return;
}
if(!_toolbarBackgroundView){
_toolbarBackgroundView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMakeZero());
objj_msgSend(_toolbarBackgroundView,"setBackgroundColor:",objj_msgSend(objj_msgSend(_7,"class"),"toolbarBackgroundColor"));
objj_msgSend(_toolbarBackgroundView,"setAutoresizingMask:",CPViewWidthSizable);
objj_msgSend(_7,"addSubview:positioned:relativeTo:",_toolbarBackgroundView,CPWindowBelow,nil);
}
var _b=CGRectMakeZero(),_c=objj_msgSend(_7,"toolbarOffset");
_b.origin=CGPointMake(_c.width,_c.height);
_b.size=objj_msgSend(_toolbarView,"frame").size;
objj_msgSend(_toolbarBackgroundView,"setFrame:",_b);
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("toolbarBackgroundColor"),function(_d,_e){
with(_d){
if(!_1){
_1=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(_CPBorderlessBridgeWindowView,"class")),"pathForResource:","_CPToolbarView/_CPToolbarViewBackground.png"),CGSizeMake(1,59)));
}
return _1;
}
})]);
p;25;_CPBorderlessWindowView.jt;190;@STATIC;1.0;i;15;_CPWindowView.jt;152;
objj_executeFile("_CPWindowView.j",YES);
var _1=objj_allocateClassPair(_CPWindowView,"_CPBorderlessWindowView"),_2=_1.isa;
objj_registerClassPair(_1);
p;23;_CPDocModalWindowView.jt;1359;@STATIC;1.0;i;15;_CPWindowView.jt;1320;
objj_executeFile("_CPWindowView.j",YES);
var _1=nil;
var _2=objj_allocateClassPair(_CPWindowView,"_CPDocModalWindowView"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_bodyView")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("initWithFrame:styleMask:"),function(_4,_5,_6,_7){
with(_4){
_4=objj_msgSendSuper({receiver:_4,super_class:objj_getClass("_CPDocModalWindowView").super_class},"initWithFrame:styleMask:",_6,_7);
if(_4){
var _8=objj_msgSend(_4,"class"),_9=objj_msgSend(_4,"bounds");
_bodyView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMake(0,0,CGRectGetWidth(_9),CGRectGetHeight(_9)));
objj_msgSend(_bodyView,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
objj_msgSend(_bodyView,"setBackgroundColor:",objj_msgSend(_8,"bodyBackgroundColor"));
objj_msgSend(_bodyView,"setHitTests:",NO);
objj_msgSend(_4,"addSubview:",_bodyView);
}
return _4;
}
}),new objj_method(sel_getUid("contentRectForFrameRect:"),function(_a,_b,_c){
with(_a){
return _c;
}
}),new objj_method(sel_getUid("frameRectForContentRect:"),function(_d,_e,_f){
with(_d){
return _f;
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("bodyBackgroundColor"),function(_10,_11){
with(_10){
if(!_1){
_1=objj_msgSend(CPColor,"colorWithWhite:alpha:",0.96,0.9);
}
return _1;
}
})]);
p;18;_CPHUDWindowView.jt;6961;@STATIC;1.0;t;6942;
var _1=nil,_2=nil;
var _3=26;
var _4=objj_allocateClassPair(_CPWindowView,"_CPHUDWindowView"),_5=_4.isa;
class_addIvars(_4,[new objj_ivar("_toolbarView"),new objj_ivar("_titleField"),new objj_ivar("_closeButton")]);
objj_registerClassPair(_4);
class_addMethods(_4,[new objj_method(sel_getUid("contentRectForFrameRect:"),function(_6,_7,_8){
with(_6){
var _9=objj_msgSend(objj_msgSend(_6,"class"),"contentRectForFrameRect:",_8);
if(objj_msgSend(objj_msgSend(objj_msgSend(_6,"window"),"toolbar"),"isVisible")){
toolbarHeight=CGRectGetHeight(objj_msgSend(objj_msgSend(_6,"toolbarView"),"frame"));
_9.origin.y+=toolbarHeight;
_9.size.height-=toolbarHeight;
}
return _9;
}
}),new objj_method(sel_getUid("frameRectForContentRect:"),function(_a,_b,_c){
with(_a){
var _d=objj_msgSend(objj_msgSend(_a,"class"),"frameRectForContentRect:",_c);
if(objj_msgSend(objj_msgSend(objj_msgSend(_a,"window"),"toolbar"),"isVisible")){
toolbarHeight=CGRectGetHeight(objj_msgSend(objj_msgSend(_a,"toolbarView"),"frame"));
_d.origin.y-=toolbarHeight;
_d.size.height+=toolbarHeight;
}
return _d;
}
}),new objj_method(sel_getUid("initWithFrame:styleMask:"),function(_e,_f,_10,_11){
with(_e){
_e=objj_msgSendSuper({receiver:_e,super_class:objj_getClass("_CPHUDWindowView").super_class},"initWithFrame:styleMask:",_10,_11);
if(_e){
var _12=objj_msgSend(_e,"bounds");
objj_msgSend(_e,"setBackgroundColor:",_1);
_titleField=objj_msgSend(objj_msgSend(CPTextField,"alloc"),"initWithFrame:",CGRectMakeZero());
objj_msgSend(_titleField,"setHitTests:",NO);
objj_msgSend(_titleField,"setFont:",objj_msgSend(CPFont,"systemFontOfSize:",11));
objj_msgSend(_titleField,"setTextColor:",objj_msgSend(CPColor,"whiteColor"));
objj_msgSend(_titleField,"setTextShadowColor:",objj_msgSend(CPColor,"blackColor"));
objj_msgSend(_titleField,"setTextShadowOffset:",CGSizeMake(0,1));
objj_msgSend(_titleField,"setAutoresizingMask:",CPViewWidthSizable);
objj_msgSend(_titleField,"setLineBreakMode:",CPLineBreakByTruncatingTail);
objj_msgSend(_titleField,"setAlignment:",CPCenterTextAlignment);
objj_msgSend(_titleField,"setStringValue:","Untitled");
objj_msgSend(_titleField,"sizeToFit");
objj_msgSend(_titleField,"setAutoresizingMask:",CPViewWidthSizable);
objj_msgSend(_titleField,"setStringValue:","");
objj_msgSend(_titleField,"setFrame:",CGRectMake(20,3,CGRectGetWidth(objj_msgSend(_e,"bounds"))-40,CGRectGetHeight(objj_msgSend(_titleField,"frame"))));
objj_msgSend(_e,"addSubview:",_titleField);
if(_styleMask&CPClosableWindowMask){
var _13=objj_msgSend(_CPHUDWindowViewCloseImage,"size");
_closeButton=objj_msgSend(objj_msgSend(CPButton,"alloc"),"initWithFrame:",CGRectMake(4,4,_13.width,_13.height));
objj_msgSend(_closeButton,"setBordered:",NO);
objj_msgSend(_closeButton,"setImage:",_CPHUDWindowViewCloseImage);
objj_msgSend(_closeButton,"setAlternateImage:",_CPHUDWindowViewCloseActiveImage);
objj_msgSend(_e,"addSubview:",_closeButton);
}
objj_msgSend(_e,"setResizeIndicatorOffset:",CGSizeMake(5,5));
}
return _e;
}
}),new objj_method(sel_getUid("viewDidMoveToWindow"),function(_14,_15){
with(_14){
objj_msgSend(_closeButton,"setTarget:",objj_msgSend(_14,"window"));
objj_msgSend(_closeButton,"setAction:",sel_getUid("performClose:"));
}
}),new objj_method(sel_getUid("setTitle:"),function(_16,_17,_18){
with(_16){
objj_msgSend(_titleField,"setStringValue:",_18);
}
}),new objj_method(sel_getUid("toolbarView"),function(_19,_1a){
with(_19){
return _toolbarView;
}
}),new objj_method(sel_getUid("toolbarLabelColor"),function(_1b,_1c){
with(_1b){
return objj_msgSend(CPColor,"whiteColor");
}
}),new objj_method(sel_getUid("toolbarLabelShadowColor"),function(_1d,_1e){
with(_1d){
return objj_msgSend(CPColor,"blackColor");
}
}),new objj_method(sel_getUid("toolbarOffset"),function(_1f,_20){
with(_1f){
return CGSizeMake(0,_3);
}
}),new objj_method(sel_getUid("tile"),function(_21,_22){
with(_21){
objj_msgSendSuper({receiver:_21,super_class:objj_getClass("_CPHUDWindowView").super_class},"tile");
var _23=objj_msgSend(_21,"window"),_24=objj_msgSend(_21,"bounds"),_25=CGRectGetWidth(_24);
objj_msgSend(_titleField,"setFrame:",CGRectMake(20,3,_25-40,CGRectGetHeight(objj_msgSend(_titleField,"frame"))));
var _26=objj_msgSend(_21,"toolbarMaxY");
objj_msgSend(objj_msgSend(_23,"contentView"),"setFrameOrigin:",CGPointMake(0,_26,_25,CGRectGetHeight(_24)-_26));
}
})]);
class_addMethods(_5,[new objj_method(sel_getUid("initialize"),function(_27,_28){
with(_27){
if(_27!=objj_msgSend(_CPHUDWindowView,"class")){
return;
}
var _29=objj_msgSend(CPBundle,"bundleForClass:",_27);
_1=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPNinePartImage,"alloc"),"initWithImageSlices:",[objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_29,"pathForResource:","CPWindow/HUD/CPWindowHUDBackground0.png"),CPSizeMake(6,78)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_29,"pathForResource:","CPWindow/HUD/CPWindowHUDBackground1.png"),CPSizeMake(1,78)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_29,"pathForResource:","CPWindow/HUD/CPWindowHUDBackground2.png"),CPSizeMake(6,78)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_29,"pathForResource:","CPWindow/HUD/CPWindowHUDBackground3.png"),CPSizeMake(6,1)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_29,"pathForResource:","CPWindow/HUD/CPWindowHUDBackground4.png"),CPSizeMake(5,5)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_29,"pathForResource:","CPWindow/HUD/CPWindowHUDBackground5.png"),CPSizeMake(6,1)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_29,"pathForResource:","CPWindow/HUD/CPWindowHUDBackground6.png"),CPSizeMake(6,6)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_29,"pathForResource:","CPWindow/HUD/CPWindowHUDBackground7.png"),CPSizeMake(6,6)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_29,"pathForResource:","CPWindow/HUD/CPWindowHUDBackground8.png"),CPSizeMake(6,6))]));
_CPHUDWindowViewCloseImage=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_29,"pathForResource:","HUDTheme/WindowClose.png"),CPSizeMake(20,20));
_CPHUDWindowViewCloseActiveImage=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_29,"pathForResource:","HUDTheme/WindowCloseActive.png"),CPSizeMake(20,20));
}
}),new objj_method(sel_getUid("contentRectForFrameRect:"),function(_2a,_2b,_2c){
with(_2a){
var _2d=CGRectMakeCopy(_2c),_2e=_3;
_2d.origin.y+=_2e;
_2d.size.height-=_2e;
return _2d;
}
}),new objj_method(sel_getUid("frameRectForContentRect:"),function(_2f,_30,_31){
with(_2f){
var _32=CGRectMakeCopy(_31),_33=_3;
_32.origin.y-=_33;
_32.size.height+=_33;
return _32;
}
})]);
p;23;_CPStandardWindowView.jt;11862;@STATIC;1.0;i;15;_CPWindowView.jt;11822;
objj_executeFile("_CPWindowView.j",YES);
var _1=41;
var _2=nil,_3=nil;
var _4=objj_allocateClassPair(CPView,"_CPTexturedWindowHeadView"),_5=_4.isa;
class_addIvars(_4,[new objj_ivar("_gradientView"),new objj_ivar("_solidView"),new objj_ivar("_dividerView")]);
objj_registerClassPair(_4);
class_addMethods(_4,[new objj_method(sel_getUid("initWithFrame:"),function(_6,_7,_8){
with(_6){
_6=objj_msgSendSuper({receiver:_6,super_class:objj_getClass("_CPTexturedWindowHeadView").super_class},"initWithFrame:",_8);
if(_6){
var _9=objj_msgSend(_6,"class"),_a=objj_msgSend(_6,"bounds");
_gradientView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMake(0,0,CGRectGetWidth(_a),_1));
objj_msgSend(_gradientView,"setBackgroundColor:",objj_msgSend(_9,"gradientColor"));
objj_msgSend(_6,"addSubview:",_gradientView);
_solidView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMake(0,_1,CGRectGetWidth(_a),CGRectGetHeight(_a)-_1));
objj_msgSend(_solidView,"setBackgroundColor:",objj_msgSend(_9,"solidColor"));
objj_msgSend(_6,"addSubview:",_solidView);
}
return _6;
}
}),new objj_method(sel_getUid("resizeSubviewsWithOldSize:"),function(_b,_c,_d){
with(_b){
var _e=objj_msgSend(_b,"bounds");
objj_msgSend(_gradientView,"setFrameSize:",CGSizeMake(CGRectGetWidth(_e),_1));
objj_msgSend(_solidView,"setFrameSize:",CGSizeMake(CGRectGetWidth(_e),CGRectGetHeight(_e)-_1));
}
})]);
class_addMethods(_5,[new objj_method(sel_getUid("gradientColor"),function(_f,_10){
with(_f){
if(!_2){
var _11=objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(_CPWindowView,"class"));
_2=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPThreePartImage,"alloc"),"initWithImageSlices:isVertical:",[objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_11,"pathForResource:","CPWindow/Standard/CPWindowStandardTop0.png"),CGSizeMake(6,41)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_11,"pathForResource:","CPWindow/Standard/CPWindowStandardTop1.png"),CGSizeMake(1,41)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_11,"pathForResource:","CPWindow/Standard/CPWindowStandardTop2.png"),CGSizeMake(6,41))],NO));
}
return _2;
}
}),new objj_method(sel_getUid("solidColor"),function(_12,_13){
with(_12){
if(!_3){
_3=objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",195/255,195/255,195/255,1);
}
return _3;
}
})]);
var _14=nil,_15=nil,_16=nil,_17=nil,_18=nil,_19=nil,_1a=nil,_1b=nil,_1c=nil;
var _1d=41;
STANDARD_TITLEBAR_HEIGHT=25;
var _4=objj_allocateClassPair(_CPWindowView,"_CPStandardWindowView"),_5=_4.isa;
class_addIvars(_4,[new objj_ivar("_headView"),new objj_ivar("_dividerView"),new objj_ivar("_bodyView"),new objj_ivar("_toolbarView"),new objj_ivar("_titleField"),new objj_ivar("_closeButton"),new objj_ivar("_minimizeButton"),new objj_ivar("_isDocumentEdited")]);
objj_registerClassPair(_4);
class_addMethods(_4,[new objj_method(sel_getUid("contentRectForFrameRect:"),function(_1e,_1f,_20){
with(_1e){
var _21=objj_msgSend(objj_msgSend(_1e,"class"),"contentRectForFrameRect:",_20),_22=objj_msgSend(objj_msgSend(_1e,"window"),"toolbar");
if(objj_msgSend(_22,"isVisible")){
toolbarHeight=CGRectGetHeight(objj_msgSend(objj_msgSend(_22,"_toolbarView"),"frame"));
_21.origin.y+=toolbarHeight;
_21.size.height-=toolbarHeight;
}
return _21;
}
}),new objj_method(sel_getUid("frameRectForContentRect:"),function(_23,_24,_25){
with(_23){
var _26=objj_msgSend(objj_msgSend(_23,"class"),"frameRectForContentRect:",_25),_27=objj_msgSend(objj_msgSend(_23,"window"),"toolbar");
if(objj_msgSend(_27,"isVisible")){
toolbarHeight=CGRectGetHeight(objj_msgSend(objj_msgSend(_27,"_toolbarView"),"frame"));
_26.origin.y-=toolbarHeight;
_26.size.height+=toolbarHeight;
}
return _26;
}
}),new objj_method(sel_getUid("initWithFrame:styleMask:"),function(_28,_29,_2a,_2b){
with(_28){
_28=objj_msgSendSuper({receiver:_28,super_class:objj_getClass("_CPStandardWindowView").super_class},"initWithFrame:styleMask:",_2a,_2b);
if(_28){
var _2c=objj_msgSend(_28,"class"),_2d=objj_msgSend(_28,"bounds");
_headView=objj_msgSend(objj_msgSend(_CPTexturedWindowHeadView,"alloc"),"initWithFrame:",CGRectMake(0,0,CGRectGetWidth(_2d),objj_msgSend(objj_msgSend(_28,"class"),"titleBarHeight")));
objj_msgSend(_headView,"setAutoresizingMask:",CPViewWidthSizable);
objj_msgSend(_headView,"setHitTests:",NO);
objj_msgSend(_28,"addSubview:",_headView);
_dividerView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMake(0,CGRectGetMaxY(objj_msgSend(_headView,"frame")),CGRectGetWidth(_2d),1));
objj_msgSend(_dividerView,"setAutoresizingMask:",CPViewWidthSizable);
objj_msgSend(_dividerView,"setBackgroundColor:",objj_msgSend(_2c,"dividerBackgroundColor"));
objj_msgSend(_dividerView,"setHitTests:",NO);
objj_msgSend(_28,"addSubview:",_dividerView);
var y=CGRectGetMaxY(objj_msgSend(_dividerView,"frame"));
_bodyView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMake(0,y,CGRectGetWidth(_2d),CGRectGetHeight(_2d)-y));
objj_msgSend(_bodyView,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
objj_msgSend(_bodyView,"setBackgroundColor:",objj_msgSend(_2c,"bodyBackgroundColor"));
objj_msgSend(_bodyView,"setHitTests:",NO);
objj_msgSend(_28,"addSubview:",_bodyView);
objj_msgSend(_28,"setResizeIndicatorOffset:",CGSizeMake(2,2));
_titleField=objj_msgSend(objj_msgSend(CPTextField,"alloc"),"initWithFrame:",CGRectMakeZero());
objj_msgSend(_titleField,"setFont:",objj_msgSend(CPFont,"boldSystemFontOfSize:",12));
objj_msgSend(_titleField,"setAutoresizingMask:",CPViewWidthSizable);
objj_msgSend(_titleField,"setLineBreakMode:",CPLineBreakByTruncatingTail);
objj_msgSend(_titleField,"setAlignment:",CPCenterTextAlignment);
objj_msgSend(_titleField,"setTextShadowColor:",objj_msgSend(CPColor,"whiteColor"));
objj_msgSend(_titleField,"setTextShadowOffset:",CGSizeMake(0,1));
objj_msgSend(_titleField,"setStringValue:","Untitled");
objj_msgSend(_titleField,"sizeToFit");
objj_msgSend(_titleField,"setAutoresizingMask:",CPViewWidthSizable);
objj_msgSend(_titleField,"setStringValue:","");
objj_msgSend(_28,"addSubview:",_titleField);
if(_styleMask&CPClosableWindowMask){
if(!_17){
var _2e=objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(CPWindow,"class"));
_17=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_2e,"pathForResource:","CPWindow/Standard/CPWindowStandardCloseButton.png"),CGSizeMake(16,16));
_18=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_2e,"pathForResource:","CPWindow/Standard/CPWindowStandardCloseButtonHighlighted.png"),CGSizeMake(16,16));
_19=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_2e,"pathForResource:","CPWindow/Standard/CPWindowStandardCloseButtonUnsaved.png"),CGSizeMake(16,16));
_1a=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_2e,"pathForResource:","CPWindow/Standard/CPWindowStandardCloseButtonUnsavedHighlighted.png"),CGSizeMake(16,16));
}
_closeButton=objj_msgSend(objj_msgSend(CPButton,"alloc"),"initWithFrame:",CGRectMake(8,7,16,16));
objj_msgSend(_closeButton,"setBordered:",NO);
objj_msgSend(_28,"_updateCloseButton");
objj_msgSend(_28,"addSubview:",_closeButton);
}
if(_styleMask&CPMiniaturizableWindowMask&&!objj_msgSend(CPPlatform,"isBrowser")){
if(!_1b){
var _2e=objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(CPWindow,"class"));
_1b=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_2e,"pathForResource:","CPWindow/Standard/CPWindowStandardMinimizeButton.png"),CGSizeMake(16,16));
_1c=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_2e,"pathForResource:","CPWindow/Standard/CPWindowStandardMinimizeButtonHighlighted.png"),CGSizeMake(16,16));
}
_minimizeButton=objj_msgSend(objj_msgSend(CPButton,"alloc"),"initWithFrame:",CGRectMake(27,7,16,16));
objj_msgSend(_minimizeButton,"setBordered:",NO);
objj_msgSend(_minimizeButton,"setImage:",_1b);
objj_msgSend(_minimizeButton,"setAlternateImage:",_1c);
objj_msgSend(_28,"addSubview:",_minimizeButton);
}
objj_msgSend(_28,"tile");
}
return _28;
}
}),new objj_method(sel_getUid("viewDidMoveToWindow"),function(_2f,_30){
with(_2f){
objj_msgSend(_closeButton,"setTarget:",objj_msgSend(_2f,"window"));
objj_msgSend(_closeButton,"setAction:",sel_getUid("performClose:"));
objj_msgSend(_minimizeButton,"setTarget:",objj_msgSend(_2f,"window"));
objj_msgSend(_minimizeButton,"setAction:",sel_getUid("performMiniaturize:"));
}
}),new objj_method(sel_getUid("toolbarOffset"),function(_31,_32){
with(_31){
return CGSizeMake(0,objj_msgSend(objj_msgSend(_31,"class"),"titleBarHeight"));
}
}),new objj_method(sel_getUid("tile"),function(_33,_34){
with(_33){
objj_msgSendSuper({receiver:_33,super_class:objj_getClass("_CPStandardWindowView").super_class},"tile");
var _35=objj_msgSend(_33,"window"),_36=objj_msgSend(_33,"bounds"),_37=CGRectGetWidth(_36);
objj_msgSend(_headView,"setFrameSize:",CGSizeMake(_37,objj_msgSend(_33,"toolbarMaxY")));
objj_msgSend(_dividerView,"setFrame:",CGRectMake(0,CGRectGetMaxY(objj_msgSend(_headView,"frame")),_37,1));
var _38=CGRectGetMaxY(objj_msgSend(_dividerView,"frame"));
objj_msgSend(_bodyView,"setFrame:",CGRectMake(0,_38,_37,CGRectGetHeight(_36)-_38));
var _39=8;
if(_closeButton){
_39+=19;
}
if(_minimizeButton){
_39+=19;
}
objj_msgSend(_titleField,"setFrame:",CGRectMake(_39,5,_37-_39*2,CGRectGetHeight(objj_msgSend(_titleField,"frame"))));
objj_msgSend(objj_msgSend(_35,"contentView"),"setFrameOrigin:",CGPointMake(0,CGRectGetMaxY(objj_msgSend(_dividerView,"frame"))));
}
}),new objj_method(sel_getUid("_updateCloseButton"),function(_3a,_3b){
with(_3a){
if(_isDocumentEdited){
objj_msgSend(_closeButton,"setImage:",_19);
objj_msgSend(_closeButton,"setAlternateImage:",_1a);
}else{
objj_msgSend(_closeButton,"setImage:",_17);
objj_msgSend(_closeButton,"setAlternateImage:",_18);
}
}
}),new objj_method(sel_getUid("setDocumentEdited:"),function(_3c,_3d,_3e){
with(_3c){
_isDocumentEdited=_3e;
objj_msgSend(_3c,"_updateCloseButton");
}
}),new objj_method(sel_getUid("setTitle:"),function(_3f,_40,_41){
with(_3f){
objj_msgSend(_titleField,"setStringValue:",_41);
}
}),new objj_method(sel_getUid("mouseDown:"),function(_42,_43,_44){
with(_42){
if(CGRectContainsPoint(objj_msgSend(_headView,"frame"),objj_msgSend(_42,"convertPoint:fromView:",objj_msgSend(_44,"locationInWindow"),nil))){
return objj_msgSend(_42,"trackMoveWithEvent:",_44);
}
objj_msgSendSuper({receiver:_42,super_class:objj_getClass("_CPStandardWindowView").super_class},"mouseDown:",_44);
}
})]);
class_addMethods(_5,[new objj_method(sel_getUid("bodyBackgroundColor"),function(_45,_46){
with(_45){
if(!_14){
_14=objj_msgSend(CPColor,"colorWithWhite:alpha:",0.96,1);
}
return _14;
}
}),new objj_method(sel_getUid("dividerBackgroundColor"),function(_47,_48){
with(_47){
if(!_15){
_15=objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",125/255,125/255,125/255,1);
}
return _15;
}
}),new objj_method(sel_getUid("titleColor"),function(_49,_4a){
with(_49){
if(!_16){
_16=objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",44/255,44/255,44/255,1);
}
return _16;
}
}),new objj_method(sel_getUid("contentRectForFrameRect:"),function(_4b,_4c,_4d){
with(_4b){
var _4e=CGRectMakeCopy(_4d),_4f=objj_msgSend(_4b,"titleBarHeight")+1;
_4e.origin.y+=_4f;
_4e.size.height-=_4f;
return _4e;
}
}),new objj_method(sel_getUid("frameRectForContentRect:"),function(_50,_51,_52){
with(_50){
var _53=CGRectMakeCopy(_52),_54=objj_msgSend(_50,"titleBarHeight")+1;
_53.origin.y-=_54;
_53.size.height+=_54;
return _53;
}
}),new objj_method(sel_getUid("titleBarHeight"),function(_55,_56){
with(_55){
return STANDARD_TITLEBAR_HEIGHT;
}
})]);
p;15;_CPWindowView.jt;9275;@STATIC;1.0;i;8;CPView.ji;13;CPImageView.jt;9226;
objj_executeFile("CPView.j",YES);
objj_executeFile("CPImageView.j",YES);
var _1=nil;
var _2=objj_allocateClassPair(CPView,"_CPWindowView"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_styleMask"),new objj_ivar("_resizeIndicator"),new objj_ivar("_resizeIndicatorOffset"),new objj_ivar("_toolbarView"),new objj_ivar("_toolbarOffset"),new objj_ivar("_resizeFrame"),new objj_ivar("_mouseDraggedPoint"),new objj_ivar("_cachedScreenFrame")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("contentRectForFrameRect:"),function(_4,_5,_6){
with(_4){
return objj_msgSend(objj_msgSend(_4,"class"),"contentRectForFrameRect:",_6);
}
}),new objj_method(sel_getUid("frameRectForContentRect:"),function(_7,_8,_9){
with(_7){
return objj_msgSend(objj_msgSend(_7,"class"),"frameRectForContentRect:",_9);
}
}),new objj_method(sel_getUid("initWithFrame:styleMask:"),function(_a,_b,_c,_d){
with(_a){
_a=objj_msgSendSuper({receiver:_a,super_class:objj_getClass("_CPWindowView").super_class},"initWithFrame:",_c);
if(_a){
_styleMask=_d;
_resizeIndicatorOffset=CGSizeMakeZero();
_toolbarOffset=CGSizeMakeZero();
}
return _a;
}
}),new objj_method(sel_getUid("setDocumentEdited:"),function(_e,_f,_10){
with(_e){
}
}),new objj_method(sel_getUid("setTitle:"),function(_11,_12,_13){
with(_11){
}
}),new objj_method(sel_getUid("acceptsFirstMouse:"),function(_14,_15,_16){
with(_14){
return YES;
}
}),new objj_method(sel_getUid("mouseDown:"),function(_17,_18,_19){
with(_17){
var _1a=objj_msgSend(_17,"window");
if((_styleMask&CPResizableWindowMask)&&_resizeIndicator){
var _1b=objj_msgSend(_resizeIndicator,"frame");
if(CGRectContainsPoint(_1b,objj_msgSend(_17,"convertPoint:fromView:",objj_msgSend(_19,"locationInWindow"),nil))){
return objj_msgSend(_17,"trackResizeWithEvent:",_19);
}
}
if(objj_msgSend(_1a,"isMovableByWindowBackground")){
objj_msgSend(_17,"trackMoveWithEvent:",_19);
}else{
objj_msgSendSuper({receiver:_17,super_class:objj_getClass("_CPWindowView").super_class},"mouseDown:",_19);
}
}
}),new objj_method(sel_getUid("trackResizeWithEvent:"),function(_1c,_1d,_1e){
with(_1c){
var _1f=objj_msgSend(_1e,"locationInWindow"),_20=objj_msgSend(_1e,"type");
if(_20===CPLeftMouseUp){
return;
}
var _21=objj_msgSend(_1c,"window");
if(_20===CPLeftMouseDown){
var _22=objj_msgSend(_21,"frame");
_resizeFrame=CGRectMake(_1f.x,_1f.y,CGRectGetWidth(_22),CGRectGetHeight(_22));
}else{
if(_20===CPLeftMouseDragged){
var _23=CGSizeMake(CGRectGetWidth(_resizeFrame)+_1f.x-CGRectGetMinX(_resizeFrame),CGRectGetHeight(_resizeFrame)+_1f.y-CGRectGetMinY(_resizeFrame));
if(_21._isSheet&&_21._parentView&&(_21._frame.size.width!==_23.width)){
objj_msgSend(_21._parentView,"_setAttachedSheetFrameOrigin");
}
objj_msgSend(_21,"setFrameSize:",_23);
}
}
objj_msgSend(CPApp,"setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:",_1c,sel_getUid("trackResizeWithEvent:"),CPLeftMouseDraggedMask|CPLeftMouseUpMask,nil,nil,YES);
}
}),new objj_method(sel_getUid("_pointWithinScreenFrame:"),function(_24,_25,_26){
with(_24){
if(!objj_msgSend(CPPlatform,"isBrowser")){
return _26;
}
var _27=_cachedScreenFrame;
if(!_27){
_27=objj_msgSend(objj_msgSend(CPPlatformWindow,"primaryPlatformWindow"),"visibleFrame");
}
var _28=0;
if(objj_msgSend(CPMenu,"menuBarVisible")){
_28=objj_msgSend(objj_msgSend(CPApp,"mainMenu"),"menuBarHeight");
}
var _29=CGPointMake(0,0);
_29.x=MIN(MAX(_26.x,-_frame.size.width+4),CGRectGetMaxX(_27)-4);
_29.y=MIN(MAX(_26.y,_28),CGRectGetMaxY(_27)-8);
return _29;
}
}),new objj_method(sel_getUid("trackMoveWithEvent:"),function(_2a,_2b,_2c){
with(_2a){
var _2d=objj_msgSend(_2c,"type");
if(_2d===CPLeftMouseUp){
_cachedScreenFrame=nil;
return;
}else{
if(_2d===CPLeftMouseDown){
_mouseDraggedPoint=objj_msgSend(objj_msgSend(_2a,"window"),"convertBaseToGlobal:",objj_msgSend(_2c,"locationInWindow"));
_cachedScreenFrame=objj_msgSend(objj_msgSend(CPPlatformWindow,"primaryPlatformWindow"),"visibleFrame");
}else{
if(_2d===CPLeftMouseDragged){
var _2e=objj_msgSend(_2a,"window"),_2f=objj_msgSend(_2e,"frame"),_30=objj_msgSend(_2e,"convertBaseToGlobal:",objj_msgSend(_2c,"locationInWindow")),_31=objj_msgSend(_2a,"_pointWithinScreenFrame:",CGPointMake((_2f.origin.x)+(_30.x-_mouseDraggedPoint.x),(_2f.origin.y)+(_30.y-_mouseDraggedPoint.y)));
objj_msgSend(_2e,"setFrameOrigin:",_31);
_mouseDraggedPoint=objj_msgSend(_2a,"_pointWithinScreenFrame:",_30);
}
}
}
objj_msgSend(CPApp,"setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue:",_2a,sel_getUid("trackMoveWithEvent:"),CPLeftMouseDraggedMask|CPLeftMouseUpMask,nil,nil,YES);
}
}),new objj_method(sel_getUid("setShowsResizeIndicator:"),function(_32,_33,_34){
with(_32){
if(_34){
var _35=objj_msgSend(_1,"size"),_36=objj_msgSend(_32,"frame").size;
_resizeIndicator=objj_msgSend(objj_msgSend(CPImageView,"alloc"),"initWithFrame:",CGRectMake(_36.width-_35.width-_resizeIndicatorOffset.width,_36.height-_35.height-_resizeIndicatorOffset.height,_35.width,_35.height));
objj_msgSend(_resizeIndicator,"setImage:",_1);
objj_msgSend(_resizeIndicator,"setAutoresizingMask:",CPViewMinXMargin|CPViewMinYMargin);
objj_msgSend(_32,"addSubview:",_resizeIndicator);
}else{
objj_msgSend(_resizeIndicator,"removeFromSuperview");
_resizeIndicator=nil;
}
}
}),new objj_method(sel_getUid("showsResizeIndicator"),function(_37,_38){
with(_37){
return _resizeIndicator!==nil;
}
}),new objj_method(sel_getUid("setResizeIndicatorOffset:"),function(_39,_3a,_3b){
with(_39){
if(CGSizeEqualToSize(_resizeIndicatorOffset,_3b)){
return;
}
_resizeIndicatorOffset=_3b;
if(!_resizeIndicator){
return;
}
var _3c=objj_msgSend(_resizeIndicator,"frame").size,_3d=objj_msgSend(_39,"frame").size;
objj_msgSend(_resizeIndicator,"setFrameOrigin:",CGPointMake(_3d.width-_3c.width-_3b.width,_3d.height-_3c.height-_3b.height));
}
}),new objj_method(sel_getUid("resizeIndicatorOffset"),function(_3e,_3f){
with(_3e){
return _resizeIndicatorOffset;
}
}),new objj_method(sel_getUid("windowDidChangeDocumentEdited"),function(_40,_41){
with(_40){
}
}),new objj_method(sel_getUid("windowDidChangeDocumentSaving"),function(_42,_43){
with(_42){
}
}),new objj_method(sel_getUid("showsToolbar"),function(_44,_45){
with(_44){
return YES;
}
}),new objj_method(sel_getUid("toolbarOffset"),function(_46,_47){
with(_46){
return _toolbarOffset;
}
}),new objj_method(sel_getUid("toolbarLabelColor"),function(_48,_49){
with(_48){
return objj_msgSend(CPColor,"blackColor");
}
}),new objj_method(sel_getUid("toolbarMaxY"),function(_4a,_4b){
with(_4a){
if(!_toolbarView||objj_msgSend(_toolbarView,"isHidden")){
return objj_msgSend(_4a,"toolbarOffset").height;
}
return CGRectGetMaxY(objj_msgSend(_toolbarView,"frame"));
}
}),new objj_method(sel_getUid("toolbarView"),function(_4c,_4d){
with(_4c){
return _toolbarView;
}
}),new objj_method(sel_getUid("tile"),function(_4e,_4f){
with(_4e){
var _50=objj_msgSend(_4e,"window"),_51=objj_msgSend(_4e,"bounds"),_52=CGRectGetWidth(_51);
if(objj_msgSend(objj_msgSend(_50,"toolbar"),"isVisible")){
var _53=objj_msgSend(_4e,"toolbarView"),_54=objj_msgSend(_4e,"toolbarOffset");
objj_msgSend(_53,"setFrame:",CGRectMake(_54.width,_54.height,_52,CGRectGetHeight(objj_msgSend(_53,"frame"))));
}
if(objj_msgSend(_4e,"showsResizeIndicator")){
var _55=objj_msgSend(_resizeIndicator,"frame").size,_56=objj_msgSend(_4e,"bounds").size;
objj_msgSend(_resizeIndicator,"setFrameOrigin:",CGPointMake(_56.width-_55.width-_resizeIndicatorOffset.width,_56.height-_55.height-_resizeIndicatorOffset.height));
}
}
}),new objj_method(sel_getUid("noteToolbarChanged"),function(_57,_58){
with(_57){
var _59=objj_msgSend(_57,"window"),_5a=objj_msgSend(_59,"toolbar"),_5b=objj_msgSend(_5a,"_toolbarView");
if(_toolbarView!==_5b){
objj_msgSend(_toolbarView,"removeFromSuperview");
if(_5b){
objj_msgSend(_5b,"removeFromSuperview");
objj_msgSend(_5b,"FIXME_setIsHUD:",_styleMask&CPHUDBackgroundWindowMask);
objj_msgSend(_57,"addSubview:",_5b);
}
_toolbarView=_5b;
}
objj_msgSend(_5b,"setHidden:",!objj_msgSend(_57,"showsToolbar")||!objj_msgSend(_5a,"isVisible"));
if(_59){
var _5c=objj_msgSend(_57,"convertRect:toView:",objj_msgSend(objj_msgSend(_59,"contentView"),"frame"),nil);
_5c.origin=objj_msgSend(_59,"convertBaseToGlobal:",_5c.origin);
objj_msgSend(_57,"setAutoresizesSubviews:",NO);
objj_msgSend(_59,"setFrame:",objj_msgSend(_59,"frameRectForContentRect:",_5c));
objj_msgSend(_57,"setAutoresizesSubviews:",YES);
}
objj_msgSend(_57,"tile");
}
}),new objj_method(sel_getUid("didAddSubview:"),function(_5d,_5e,_5f){
with(_5d){
if(!_resizeIndicator||_5f===_resizeIndicator){
return;
}
objj_msgSend(_5d,"addSubview:",_resizeIndicator);
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("initialize"),function(_60,_61){
with(_60){
if(_60!=objj_msgSend(_CPWindowView,"class")){
return;
}
_1=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(CPWindow,"class")),"pathForResource:","_CPWindowView/_CPWindowViewResizeIndicator.png"),CGSizeMake(12,12));
}
}),new objj_method(sel_getUid("contentRectForFrameRect:"),function(_62,_63,_64){
with(_62){
return CGRectMakeCopy(_64);
}
}),new objj_method(sel_getUid("frameRectForContentRect:"),function(_65,_66,_67){
with(_65){
return CGRectMakeCopy(_67);
}
})]);
p;10;CPWindow.jt;59241;@STATIC;1.0;I;25;Foundation/CPCountedSet.jI;33;Foundation/CPNotificationCenter.jI;26;Foundation/CPUndoManager.ji;12;CGGeometry.ji;13;CPAnimation.ji;13;CPResponder.ji;10;CPScreen.ji;18;CPPlatformWindow.ji;15;_CPWindowView.ji;23;_CPStandardWindowView.ji;23;_CPDocModalWindowView.ji;18;_CPHUDWindowView.ji;25;_CPBorderlessWindowView.ji;31;_CPBorderlessBridgeWindowView.ji;14;CPDragServer.ji;8;CPView.jt;58835;
objj_executeFile("Foundation/CPCountedSet.j",NO);
objj_executeFile("Foundation/CPNotificationCenter.j",NO);
objj_executeFile("Foundation/CPUndoManager.j",NO);
objj_executeFile("CGGeometry.j",YES);
objj_executeFile("CPAnimation.j",YES);
objj_executeFile("CPResponder.j",YES);
objj_executeFile("CPScreen.j",YES);
objj_executeFile("CPPlatformWindow.j",YES);
CPBorderlessWindowMask=0;
CPTitledWindowMask=1<<0;
CPClosableWindowMask=1<<1;
CPMiniaturizableWindowMask=1<<2;
CPResizableWindowMask=1<<3;
CPTexturedBackgroundWindowMask=1<<8;
CPBorderlessBridgeWindowMask=1<<20;
CPHUDBackgroundWindowMask=1<<21;
CPWindowNotSizable=0;
CPWindowMinXMargin=1;
CPWindowWidthSizable=2;
CPWindowMaxXMargin=4;
CPWindowMinYMargin=8;
CPWindowHeightSizable=16;
CPWindowMaxYMargin=32;
CPBackgroundWindowLevel=-1;
CPNormalWindowLevel=0;
CPFloatingWindowLevel=3;
CPSubmenuWindowLevel=3;
CPTornOffMenuWindowLevel=3;
CPMainMenuWindowLevel=24;
CPStatusWindowLevel=25;
CPModalPanelWindowLevel=8;
CPPopUpMenuWindowLevel=101;
CPDraggingWindowLevel=500;
CPScreenSaverWindowLevel=1000;
CPWindowOut=0;
CPWindowAbove=1;
CPWindowBelow=2;
CPWindowWillCloseNotification="CPWindowWillCloseNotification";
CPWindowDidBecomeMainNotification="CPWindowDidBecomeMainNotification";
CPWindowDidResignMainNotification="CPWindowDidResignMainNotification";
CPWindowDidBecomeKeyNotification="CPWindowDidBecomeKeyNotification";
CPWindowDidResignKeyNotification="CPWindowDidResignKeyNotification";
CPWindowDidResizeNotification="CPWindowDidResizeNotification";
CPWindowDidMoveNotification="CPWindowDidMoveNotification";
CPWindowWillBeginSheetNotification="CPWindowWillBeginSheetNotification";
CPWindowDidEndSheetNotification="CPWindowDidEndSheetNotification";
CPWindowDidMiniaturizeNotification="CPWindowDidMiniaturizeNotification";
CPWindowWillMiniaturizeNotification="CPWindowWillMiniaturizeNotification";
CPWindowDidDeminiaturizeNotification="CPWindowDidDeminiaturizeNotification";
CPWindowShadowStyleStandard=0;
CPWindowShadowStyleMenu=1;
CPWindowShadowStylePanel=2;
var _1=20,_2=19,_3=10,_4=10,_5=5,_6=nil;
var _7=nil,_8=nil;
var _9=objj_allocateClassPair(CPResponder,"CPWindow"),_a=_9.isa;
class_addIvars(_9,[new objj_ivar("_platformWindow"),new objj_ivar("_windowNumber"),new objj_ivar("_styleMask"),new objj_ivar("_frame"),new objj_ivar("_level"),new objj_ivar("_isVisible"),new objj_ivar("_isMiniaturized"),new objj_ivar("_isAnimating"),new objj_ivar("_hasShadow"),new objj_ivar("_isMovableByWindowBackground"),new objj_ivar("_shadowStyle"),new objj_ivar("_showsResizeIndicator"),new objj_ivar("_isDocumentEdited"),new objj_ivar("_isDocumentSaving"),new objj_ivar("_shadowView"),new objj_ivar("_windowView"),new objj_ivar("_contentView"),new objj_ivar("_toolbarView"),new objj_ivar("_mouseEnteredStack"),new objj_ivar("_leftMouseDownView"),new objj_ivar("_rightMouseDownView"),new objj_ivar("_toolbar"),new objj_ivar("_firstResponder"),new objj_ivar("_initialFirstResponder"),new objj_ivar("_delegate"),new objj_ivar("_title"),new objj_ivar("_acceptsMouseMovedEvents"),new objj_ivar("_ignoresMouseEvents"),new objj_ivar("_windowController"),new objj_ivar("_minSize"),new objj_ivar("_maxSize"),new objj_ivar("_undoManager"),new objj_ivar("_representedURL"),new objj_ivar("_registeredDraggedTypes"),new objj_ivar("_registeredDraggedTypesArray"),new objj_ivar("_inclusiveRegisteredDraggedTypes"),new objj_ivar("_defaultButton"),new objj_ivar("_defaultButtonEnabled"),new objj_ivar("_autorecalculatesKeyViewLoop"),new objj_ivar("_keyViewLoopIsDirty"),new objj_ivar("_sharesChromeWithPlatformWindow"),new objj_ivar("_DOMElement"),new objj_ivar("_autoresizingMask"),new objj_ivar("_delegateRespondsToWindowWillReturnUndoManagerSelector"),new objj_ivar("_isFullPlatformWindow"),new objj_ivar("_fullPlatformWindowSession"),new objj_ivar("_sheetContext"),new objj_ivar("_parentView"),new objj_ivar("_isSheet")]);
objj_registerClassPair(_9);
class_addMethods(_9,[new objj_method(sel_getUid("init"),function(_b,_c){
with(_b){
return objj_msgSend(_b,"initWithContentRect:styleMask:",{origin:{x:0,y:0},size:{width:0,height:0}},CPTitledWindowMask);
}
}),new objj_method(sel_getUid("initWithContentRect:styleMask:"),function(_d,_e,_f,_10){
with(_d){
_d=objj_msgSendSuper({receiver:_d,super_class:objj_getClass("CPWindow").super_class},"init");
if(_d){
var _11=objj_msgSend(objj_msgSend(_d,"class"),"_windowViewClassForStyleMask:",_10);
_frame=objj_msgSend(_11,"frameRectForContentRect:",_f);
objj_msgSend(_d,"_setSharesChromeWithPlatformWindow:",!objj_msgSend(CPPlatform,"isBrowser"));
if(objj_msgSend(CPPlatform,"isBrowser")){
objj_msgSend(_d,"setPlatformWindow:",objj_msgSend(CPPlatformWindow,"primaryPlatformWindow"));
}else{
objj_msgSend(_d,"setPlatformWindow:",objj_msgSend(objj_msgSend(CPPlatformWindow,"alloc"),"initWithContentRect:",_frame));
objj_msgSend(_d,"platformWindow")._only=_d;
}
_isFullPlatformWindow=NO;
_registeredDraggedTypes=objj_msgSend(CPSet,"set");
_registeredDraggedTypesArray=[];
_isSheet=NO;
_windowNumber=objj_msgSend(CPApp._windows,"count");
CPApp._windows[_windowNumber]=_d;
_styleMask=_10;
objj_msgSend(_d,"setLevel:",CPNormalWindowLevel);
_minSize=CGSizeMake(0,0);
_maxSize=CGSizeMake(1000000,1000000);
_windowView=objj_msgSend(objj_msgSend(_11,"alloc"),"initWithFrame:styleMask:",CGRectMake(0,0,CGRectGetWidth(_frame),CGRectGetHeight(_frame)),_10);
objj_msgSend(_windowView,"_setWindow:",_d);
objj_msgSend(_windowView,"setNextResponder:",_d);
objj_msgSend(_d,"setMovableByWindowBackground:",_10&CPHUDBackgroundWindowMask);
objj_msgSend(_d,"setContentView:",objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMakeZero()));
_firstResponder=_d;
_DOMElement=document.createElement("div");
_DOMElement.style.position="absolute";
_DOMElement.style.visibility="visible";
_DOMElement.style.zIndex=0;
if(!objj_msgSend(_d,"_sharesChromeWithPlatformWindow")){
if(NULL){
var _12=_CGPointApplyAffineTransform(CGPointMake((_frame.origin.x),(_frame.origin.y)),NULL);
}else{
var _12={x:(_frame.origin.x),y:(_frame.origin.y)};
}
_DOMElement.style.left=ROUND(_12.x)+"px";
_DOMElement.style.top=ROUND(_12.y)+"px";
}
_DOMElement.style.width=MAX(0,ROUND(1))+"px";
_DOMElement.style.height=MAX(0,ROUND(1))+"px";
_DOMElement.appendChild(_windowView._DOMElement);
objj_msgSend(_d,"setNextResponder:",CPApp);
objj_msgSend(_d,"setHasShadow:",_10!==CPBorderlessWindowMask);
if(_10&CPBorderlessBridgeWindowMask){
objj_msgSend(_d,"setFullPlatformWindow:",YES);
}
_defaultButtonEnabled=YES;
_keyViewLoopIsDirty=YES;
objj_msgSend(_d,"setShowsResizeIndicator:",_styleMask&CPResizableWindowMask);
}
return _d;
}
}),new objj_method(sel_getUid("platformWindow"),function(_13,_14){
with(_13){
return _platformWindow;
}
}),new objj_method(sel_getUid("setPlatformWindow:"),function(_15,_16,_17){
with(_15){
_platformWindow=_17;
}
}),new objj_method(sel_getUid("awakeFromCib"),function(_18,_19){
with(_18){
if(_initialFirstResponder){
objj_msgSend(_18,"makeFirstResponder:",_initialFirstResponder);
}
_keyViewLoopIsDirty=!objj_msgSend(_18,"_hasKeyViewLoop");
}
}),new objj_method(sel_getUid("_setWindowView:"),function(_1a,_1b,_1c){
with(_1a){
if(_windowView===_1c){
return;
}
var _1d=_windowView;
_windowView=_1c;
if(_1d){
objj_msgSend(_1d,"_setWindow:",nil);
objj_msgSend(_1d,"noteToolbarChanged");
_DOMElement.removeChild(_1d._DOMElement);
}
if(_windowView){
_DOMElement.appendChild(_windowView._DOMElement);
var _1e=objj_msgSend(_contentView,"convertRect:toView:",objj_msgSend(_contentView,"bounds"),nil);
_1e.origin=objj_msgSend(_1a,"convertBaseToGlobal:",_1e.origin);
objj_msgSend(_windowView,"_setWindow:",_1a);
objj_msgSend(_windowView,"setNextResponder:",_1a);
objj_msgSend(_windowView,"addSubview:",_contentView);
objj_msgSend(_windowView,"setTitle:",_title);
objj_msgSend(_windowView,"noteToolbarChanged");
objj_msgSend(_windowView,"setShowsResizeIndicator:",objj_msgSend(_1a,"showsResizeIndicator"));
objj_msgSend(_1a,"setFrame:",objj_msgSend(_1a,"frameRectForContentRect:",_1e));
}
}
}),new objj_method(sel_getUid("setFullPlatformWindow:"),function(_1f,_20,_21){
with(_1f){
if(!objj_msgSend(_platformWindow,"supportsFullPlatformWindows")){
return;
}
_21=!!_21;
if(_isFullPlatformWindow===_21){
return;
}
_isFullPlatformWindow=_21;
if(_isFullPlatformWindow){
_fullPlatformWindowSession=_CPWindowFullPlatformWindowSessionMake(_windowView,objj_msgSend(_1f,"contentRectForFrameRect:",objj_msgSend(_1f,"frame")),objj_msgSend(_1f,"hasShadow"),objj_msgSend(_1f,"level"));
var _22=objj_msgSend(objj_msgSend(_1f,"class"),"_windowViewClassForFullPlatformWindowStyleMask:",_styleMask),_23=objj_msgSend(objj_msgSend(_22,"alloc"),"initWithFrame:styleMask:",CGRectMakeZero(),_styleMask);
objj_msgSend(_1f,"_setWindowView:",_23);
objj_msgSend(_1f,"setLevel:",CPBackgroundWindowLevel);
objj_msgSend(_1f,"setHasShadow:",NO);
objj_msgSend(_1f,"setAutoresizingMask:",CPWindowWidthSizable|CPWindowHeightSizable);
objj_msgSend(_1f,"setFrame:",objj_msgSend(_platformWindow,"visibleFrame"));
}else{
var _23=_fullPlatformWindowSession.windowView;
objj_msgSend(_1f,"_setWindowView:",_23);
objj_msgSend(_1f,"setLevel:",_fullPlatformWindowSession.level);
objj_msgSend(_1f,"setHasShadow:",_fullPlatformWindowSession.hasShadow);
objj_msgSend(_1f,"setAutoresizingMask:",CPWindowNotSizable);
objj_msgSend(_1f,"setFrame:",objj_msgSend(_23,"frameRectForContentRect:",_fullPlatformWindowSession.contentRect));
}
}
}),new objj_method(sel_getUid("isFullPlatformWindow"),function(_24,_25){
with(_24){
return _isFullPlatformWindow;
}
}),new objj_method(sel_getUid("styleMask"),function(_26,_27){
with(_26){
return _styleMask;
}
}),new objj_method(sel_getUid("contentRectForFrameRect:"),function(_28,_29,_2a){
with(_28){
return objj_msgSend(_windowView,"contentRectForFrameRect:",_2a);
}
}),new objj_method(sel_getUid("frameRectForContentRect:"),function(_2b,_2c,_2d){
with(_2b){
return objj_msgSend(_windowView,"frameRectForContentRect:",_2d);
}
}),new objj_method(sel_getUid("frame"),function(_2e,_2f){
with(_2e){
return {origin:{x:_frame.origin.x,y:_frame.origin.y},size:{width:_frame.size.width,height:_frame.size.height}};
}
}),new objj_method(sel_getUid("_setClippedFrame:display:animate:"),function(_30,_31,_32,_33,_34){
with(_30){
_32.size.width=MIN(MAX(_32.size.width,_minSize.width),_maxSize.width);
_32.size.height=MIN(MAX(_32.size.height,_minSize.height),_maxSize.height);
objj_msgSend(_30,"setFrame:display:animate:",_32,_33,_34);
}
}),new objj_method(sel_getUid("setFrame:display:animate:"),function(_35,_36,_37,_38,_39){
with(_35){
_37={origin:{x:_37.origin.x,y:_37.origin.y},size:{width:_37.size.width,height:_37.size.height}};
var _3a=_37.origin.x,_3b=_3a-FLOOR(_3a);
if(_3b){
_37.origin.x=_3a>0.879?CEIL(_3a):FLOOR(_3a);
}
_3a=_37.origin.y;
_3b=_3a-FLOOR(_3a);
if(_3b){
_37.origin.y=_3a>0.879?CEIL(_3a):FLOOR(_3a);
}
_3a=_37.size.width;
_3b=_3a-FLOOR(_3a);
if(_3b){
_37.size.width=_3a>0.15?CEIL(_3a):FLOOR(_3a);
}
_3a=_37.size.height;
_3b=_3a-FLOOR(_3a);
if(_3b){
_37.size.height=_3a>0.15?CEIL(_3a):FLOOR(_3a);
}
if(_39){
var _3c=objj_msgSend(objj_msgSend(_CPWindowFrameAnimation,"alloc"),"initWithWindow:targetFrame:",_35,_37);
objj_msgSend(_3c,"startAnimation");
}else{
var _3d=_frame.origin,_3e=_37.origin;
if(!(_3d.x==_3e.x&&_3d.y==_3e.y)){
_3d.x=_3e.x;
_3d.y=_3e.y;
if(!objj_msgSend(_35,"_sharesChromeWithPlatformWindow")){
if(NULL){
var _3f=_CGPointApplyAffineTransform(CGPointMake(_3d.x,_3d.y),NULL);
}else{
var _3f={x:_3d.x,y:_3d.y};
}
_DOMElement.style.left=ROUND(_3f.x)+"px";
_DOMElement.style.top=ROUND(_3f.y)+"px";
}
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPWindowDidMoveNotification,_35);
}
var _40=_frame.size,_41=_37.size;
if(!(_40.width==_41.width&&_40.height==_41.height)){
_40.width=_41.width;
_40.height=_41.height;
objj_msgSend(_windowView,"setFrameSize:",_40);
if(_hasShadow){
objj_msgSend(_shadowView,"setFrameSize:",{width:_1+_40.width+_2,height:_4+_40.height+_3+_5});
}
if(!_isAnimating){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPWindowDidResizeNotification,_35);
}
}
if(objj_msgSend(_35,"_sharesChromeWithPlatformWindow")){
objj_msgSend(_platformWindow,"setContentRect:",_frame);
}
}
}
}),new objj_method(sel_getUid("setFrame:display:"),function(_42,_43,_44,_45){
with(_42){
objj_msgSend(_42,"_setClippedFrame:display:animate:",_44,_45,NO);
}
}),new objj_method(sel_getUid("setFrame:"),function(_46,_47,_48){
with(_46){
objj_msgSend(_46,"_setClippedFrame:display:animate:",_48,YES,NO);
}
}),new objj_method(sel_getUid("setFrameOrigin:"),function(_49,_4a,_4b){
with(_49){
objj_msgSend(_49,"_setClippedFrame:display:animate:",{origin:{x:_4b.x,y:_4b.y},size:{width:(_frame.size.width),height:(_frame.size.height)}},YES,NO);
}
}),new objj_method(sel_getUid("setFrameSize:"),function(_4c,_4d,_4e){
with(_4c){
objj_msgSend(_4c,"_setClippedFrame:display:animate:",{origin:{x:(_frame.origin.x),y:(_frame.origin.y)},size:{width:_4e.width,height:_4e.height}},YES,NO);
}
}),new objj_method(sel_getUid("orderFront:"),function(_4f,_50,_51){
with(_4f){
objj_msgSend(_platformWindow,"orderFront:",_4f);
objj_msgSend(_platformWindow,"order:window:relativeTo:",CPWindowAbove,_4f,nil);
}
}),new objj_method(sel_getUid("orderBack:"),function(_52,_53,_54){
with(_52){
}
}),new objj_method(sel_getUid("orderOut:"),function(_55,_56,_57){
with(_55){
if(objj_msgSend(_55,"_sharesChromeWithPlatformWindow")){
objj_msgSend(_platformWindow,"orderOut:",_55);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("windowWillClose:"))){
objj_msgSend(_delegate,"windowWillClose:",_55);
}
objj_msgSend(_platformWindow,"order:window:relativeTo:",CPWindowOut,_55,nil);
objj_msgSend(_55,"_updateMainAndKeyWindows");
}
}),new objj_method(sel_getUid("orderWindow:relativeTo:"),function(_58,_59,_5a,_5b){
with(_58){
objj_msgSend(_platformWindow,"order:window:relativeTo:",_5a,_58,CPApp._windows[_5b]);
}
}),new objj_method(sel_getUid("setLevel:"),function(_5c,_5d,_5e){
with(_5c){
if(_5e===_level){
return;
}
objj_msgSend(_platformWindow,"moveWindow:fromLevel:toLevel:",_5c,_level,_5e);
_level=_5e;
if(objj_msgSend(_5c,"_sharesChromeWithPlatformWindow")){
objj_msgSend(_platformWindow,"setLevel:",_5e);
}
}
}),new objj_method(sel_getUid("level"),function(_5f,_60){
with(_5f){
return _level;
}
}),new objj_method(sel_getUid("isVisible"),function(_61,_62){
with(_61){
return _isVisible;
}
}),new objj_method(sel_getUid("showsResizeIndicator"),function(_63,_64){
with(_63){
return _showsResizeIndicator;
}
}),new objj_method(sel_getUid("setShowsResizeIndicator:"),function(_65,_66,_67){
with(_65){
_67=!!_67;
if(_showsResizeIndicator===_67){
return;
}
_showsResizeIndicator=_67;
objj_msgSend(_windowView,"setShowsResizeIndicator:",objj_msgSend(_65,"showsResizeIndicator"));
}
}),new objj_method(sel_getUid("resizeIndicatorOffset"),function(_68,_69){
with(_68){
return objj_msgSend(_windowView,"resizeIndicatorOffset");
}
}),new objj_method(sel_getUid("setResizeIndicatorOffset:"),function(_6a,_6b,_6c){
with(_6a){
objj_msgSend(_windowView,"setResizeIndicatorOffset:",_6c);
}
}),new objj_method(sel_getUid("setContentView:"),function(_6d,_6e,_6f){
with(_6d){
if(_contentView){
objj_msgSend(_contentView,"removeFromSuperview");
}
var _70=CGRectMake(0,0,CGRectGetWidth(_frame),CGRectGetHeight(_frame));
_contentView=_6f;
objj_msgSend(_contentView,"setFrame:",objj_msgSend(_6d,"contentRectForFrameRect:",_70));
objj_msgSend(_contentView,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
objj_msgSend(_windowView,"addSubview:",_contentView);
}
}),new objj_method(sel_getUid("contentView"),function(_71,_72){
with(_71){
return _contentView;
}
}),new objj_method(sel_getUid("setBackgroundColor:"),function(_73,_74,_75){
with(_73){
objj_msgSend(_windowView,"setBackgroundColor:",_75);
}
}),new objj_method(sel_getUid("backgroundColor"),function(_76,_77){
with(_76){
return objj_msgSend(_windowView,"backgroundColor");
}
}),new objj_method(sel_getUid("setMinSize:"),function(_78,_79,_7a){
with(_78){
if(CGSizeEqualToSize(_minSize,_7a)){
return;
}
_minSize=CGSizeCreateCopy(_7a);
var _7b=CGSizeMakeCopy(objj_msgSend(_78,"frame").size),_7c=NO;
if(_7b.width<_minSize.width){
_7b.width=_minSize.width;
_7c=YES;
}
if(_7b.height<_minSize.height){
_7b.height=_minSize.height;
_7c=YES;
}
if(_7c){
objj_msgSend(_78,"setFrameSize:",_7b);
}
}
}),new objj_method(sel_getUid("minSize"),function(_7d,_7e){
with(_7d){
return _minSize;
}
}),new objj_method(sel_getUid("setMaxSize:"),function(_7f,_80,_81){
with(_7f){
if(CGSizeEqualToSize(_maxSize,_81)){
return;
}
_maxSize=CGSizeCreateCopy(_81);
var _82=CGSizeMakeCopy(objj_msgSend(_7f,"frame").size),_83=NO;
if(_82.width>_maxSize.width){
_82.width=_maxSize.width;
_83=YES;
}
if(_82.height>_maxSize.height){
_82.height=_maxSize.height;
_83=YES;
}
if(_83){
objj_msgSend(_7f,"setFrameSize:",_82);
}
}
}),new objj_method(sel_getUid("maxSize"),function(_84,_85){
with(_84){
return _maxSize;
}
}),new objj_method(sel_getUid("hasShadow"),function(_86,_87){
with(_86){
return _hasShadow;
}
}),new objj_method(sel_getUid("_updateShadow"),function(_88,_89){
with(_88){
if(objj_msgSend(_88,"_sharesChromeWithPlatformWindow")){
if(_shadowView){
_DOMElement.removeChild(_shadowView._DOMElement);
_shadowView=nil;
}
objj_msgSend(_platformWindow,"setHasShadow:",_hasShadow);
return;
}
if(_hasShadow&&!_shadowView){
var _8a=objj_msgSend(_windowView,"bounds");
_shadowView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMake(-_1,-_3+_5,_1+CGRectGetWidth(_8a)+_2,_3+CGRectGetHeight(_8a)+_4));
if(!_6){
var _8b=objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(CPWindow,"class"));
_6=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPNinePartImage,"alloc"),"initWithImageSlices:",[objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_8b,"pathForResource:","CPWindow/CPWindowShadow0.png"),CGSizeMake(20,19)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_8b,"pathForResource:","CPWindow/CPWindowShadow1.png"),CGSizeMake(1,19)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_8b,"pathForResource:","CPWindow/CPWindowShadow2.png"),CGSizeMake(19,19)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_8b,"pathForResource:","CPWindow/CPWindowShadow3.png"),CGSizeMake(20,1)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_8b,"pathForResource:","CPWindow/CPWindowShadow4.png"),CGSizeMake(1,1)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_8b,"pathForResource:","CPWindow/CPWindowShadow5.png"),CGSizeMake(19,1)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_8b,"pathForResource:","CPWindow/CPWindowShadow6.png"),CGSizeMake(20,18)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_8b,"pathForResource:","CPWindow/CPWindowShadow7.png"),CGSizeMake(1,18)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_8b,"pathForResource:","CPWindow/CPWindowShadow8.png"),CGSizeMake(19,18))]));
}
objj_msgSend(_shadowView,"setBackgroundColor:",_6);
objj_msgSend(_shadowView,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
_DOMElement.insertBefore(_shadowView._DOMElement,_windowView._DOMElement);
}else{
if(!_hasShadow&&_shadowView){
_DOMElement.removeChild(_shadowView._DOMElement);
_shadowView=nil;
}
}
}
}),new objj_method(sel_getUid("setHasShadow:"),function(_8c,_8d,_8e){
with(_8c){
if(_hasShadow===_8e){
return;
}
_hasShadow=_8e;
objj_msgSend(_8c,"_updateShadow");
}
}),new objj_method(sel_getUid("setShadowStyle:"),function(_8f,_90,_91){
with(_8f){
_shadowStyle=_91;
objj_msgSend(objj_msgSend(_8f,"platformWindow"),"setShadowStyle:",_shadowStyle);
}
}),new objj_method(sel_getUid("setDelegate:"),function(_92,_93,_94){
with(_92){
var _95=objj_msgSend(CPNotificationCenter,"defaultCenter");
objj_msgSend(_95,"removeObserver:name:object:",_delegate,CPWindowDidResignKeyNotification,_92);
objj_msgSend(_95,"removeObserver:name:object:",_delegate,CPWindowDidBecomeKeyNotification,_92);
objj_msgSend(_95,"removeObserver:name:object:",_delegate,CPWindowDidBecomeMainNotification,_92);
objj_msgSend(_95,"removeObserver:name:object:",_delegate,CPWindowDidResignMainNotification,_92);
objj_msgSend(_95,"removeObserver:name:object:",_delegate,CPWindowDidMoveNotification,_92);
objj_msgSend(_95,"removeObserver:name:object:",_delegate,CPWindowDidResizeNotification,_92);
_delegate=_94;
_delegateRespondsToWindowWillReturnUndoManagerSelector=objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("windowWillReturnUndoManager:"));
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("windowDidResignKey:"))){
objj_msgSend(_95,"addObserver:selector:name:object:",_delegate,sel_getUid("windowDidResignKey:"),CPWindowDidResignKeyNotification,_92);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("windowDidBecomeKey:"))){
objj_msgSend(_95,"addObserver:selector:name:object:",_delegate,sel_getUid("windowDidBecomeKey:"),CPWindowDidBecomeKeyNotification,_92);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("windowDidBecomeMain:"))){
objj_msgSend(_95,"addObserver:selector:name:object:",_delegate,sel_getUid("windowDidBecomeMain:"),CPWindowDidBecomeMainNotification,_92);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("windowDidResignMain:"))){
objj_msgSend(_95,"addObserver:selector:name:object:",_delegate,sel_getUid("windowDidResignMain:"),CPWindowDidResignMainNotification,_92);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("windowDidMove:"))){
objj_msgSend(_95,"addObserver:selector:name:object:",_delegate,sel_getUid("windowDidMove:"),CPWindowDidMoveNotification,_92);
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("windowDidResize:"))){
objj_msgSend(_95,"addObserver:selector:name:object:",_delegate,sel_getUid("windowDidResize:"),CPWindowDidResizeNotification,_92);
}
}
}),new objj_method(sel_getUid("delegate"),function(_96,_97){
with(_96){
return _delegate;
}
}),new objj_method(sel_getUid("setWindowController:"),function(_98,_99,_9a){
with(_98){
_windowController=_9a;
}
}),new objj_method(sel_getUid("windowController"),function(_9b,_9c){
with(_9b){
return _windowController;
}
}),new objj_method(sel_getUid("doCommandBySelector:"),function(_9d,_9e,_9f){
with(_9d){
if(objj_msgSend(_delegate,"respondsToSelector:",_9f)){
objj_msgSend(_delegate,"performSelector:",_9f);
}else{
objj_msgSendSuper({receiver:_9d,super_class:objj_getClass("CPWindow").super_class},"doCommandBySelector:",_9f);
}
}
}),new objj_method(sel_getUid("acceptsFirstResponder"),function(_a0,_a1){
with(_a0){
return YES;
}
}),new objj_method(sel_getUid("makeFirstResponder:"),function(_a2,_a3,_a4){
with(_a2){
if(_firstResponder==_a4){
return YES;
}
if(!objj_msgSend(_firstResponder,"resignFirstResponder")){
return NO;
}
if(!_a4||!objj_msgSend(_a4,"acceptsFirstResponder")||!objj_msgSend(_a4,"becomeFirstResponder")){
_firstResponder=_a2;
return NO;
}
_firstResponder=_a4;
return YES;
}
}),new objj_method(sel_getUid("firstResponder"),function(_a5,_a6){
with(_a5){
return _firstResponder;
}
}),new objj_method(sel_getUid("acceptsMouseMovedEvents"),function(_a7,_a8){
with(_a7){
return _acceptsMouseMovedEvents;
}
}),new objj_method(sel_getUid("setAcceptsMouseMovedEvents:"),function(_a9,_aa,_ab){
with(_a9){
_acceptsMouseMovedEvents=_ab;
}
}),new objj_method(sel_getUid("ignoresMouseEvents"),function(_ac,_ad){
with(_ac){
return _ignoresMouseEvents;
}
}),new objj_method(sel_getUid("setIgnoresMouseEvents:"),function(_ae,_af,_b0){
with(_ae){
_ignoresMouseEvents=_b0;
}
}),new objj_method(sel_getUid("title"),function(_b1,_b2){
with(_b1){
return _title;
}
}),new objj_method(sel_getUid("setTitle:"),function(_b3,_b4,_b5){
with(_b3){
_title=_b5;
objj_msgSend(_windowView,"setTitle:",_b5);
objj_msgSend(_b3,"_synchronizeMenuBarTitleWithWindowTitle");
}
}),new objj_method(sel_getUid("setTitleWithRepresentedFilename:"),function(_b6,_b7,_b8){
with(_b6){
objj_msgSend(_b6,"setRepresentedFilename:",_b8);
objj_msgSend(_b6,"setTitle:",objj_msgSend(_b8,"lastPathComponent"));
}
}),new objj_method(sel_getUid("setRepresentedFilename:"),function(_b9,_ba,_bb){
with(_b9){
objj_msgSend(_b9,"setRepresentedURL:",_bb);
}
}),new objj_method(sel_getUid("representedFilename"),function(_bc,_bd){
with(_bc){
return _representedURL;
}
}),new objj_method(sel_getUid("setRepresentedURL:"),function(_be,_bf,_c0){
with(_be){
_representedURL=_c0;
}
}),new objj_method(sel_getUid("representedURL"),function(_c1,_c2){
with(_c1){
return _representedURL;
}
}),new objj_method(sel_getUid("screen"),function(_c3,_c4){
with(_c3){
return objj_msgSend(objj_msgSend(CPScreen,"alloc"),"init");
}
}),new objj_method(sel_getUid("setMovableByWindowBackground:"),function(_c5,_c6,_c7){
with(_c5){
_isMovableByWindowBackground=_c7;
}
}),new objj_method(sel_getUid("isMovableByWindowBackground"),function(_c8,_c9){
with(_c8){
return _isMovableByWindowBackground;
}
}),new objj_method(sel_getUid("center"),function(_ca,_cb){
with(_ca){
var _cc=objj_msgSend(_ca,"frame").size,_cd=objj_msgSend(CPPlatform,"isBrowser")?objj_msgSend(_platformWindow,"contentBounds").size:objj_msgSend(objj_msgSend(_ca,"screen"),"visibleFrame").size;
objj_msgSend(_ca,"setFrameOrigin:",CGPointMake((_cd.width-_cc.width)/2,(_cd.height-_cc.height)/2));
}
}),new objj_method(sel_getUid("sendEvent:"),function(_ce,_cf,_d0){
with(_ce){
var _d1=objj_msgSend(_d0,"type"),_d2=objj_msgSend(_d0,"locationInWindow");
switch(_d1){
case CPKeyUp:
return objj_msgSend(objj_msgSend(_ce,"firstResponder"),"keyUp:",_d0);
case CPKeyDown:
return objj_msgSend(objj_msgSend(_ce,"firstResponder"),"keyDown:",_d0);
case CPScrollWheel:
return objj_msgSend(objj_msgSend(_windowView,"hitTest:",_d2),"scrollWheel:",_d0);
case CPLeftMouseUp:
if(!_leftMouseDownView){
return objj_msgSend(objj_msgSend(_windowView,"hitTest:",_d2),"mouseUp:",_d0);
}
objj_msgSend(_leftMouseDownView,"mouseUp:",_d0);
_leftMouseDownView=nil;
return;
case CPLeftMouseDown:
_leftMouseDownView=objj_msgSend(_windowView,"hitTest:",_d2);
if(_leftMouseDownView!=_firstResponder&&objj_msgSend(_leftMouseDownView,"acceptsFirstResponder")){
objj_msgSend(_ce,"makeFirstResponder:",_leftMouseDownView);
}
objj_msgSend(CPApp,"activateIgnoringOtherApps:",YES);
var _d3=objj_msgSend(_d0,"window");
if(objj_msgSend(_d3,"isKeyWindow")||objj_msgSend(_d3,"becomesKeyOnlyIfNeeded")&&!objj_msgSend(_leftMouseDownView,"needsPanelToBecomeKey")){
return objj_msgSend(_leftMouseDownView,"mouseDown:",_d0);
}else{
objj_msgSend(_ce,"makeKeyAndOrderFront:",_ce);
if(objj_msgSend(_leftMouseDownView,"acceptsFirstMouse:",_d0)){
return objj_msgSend(_leftMouseDownView,"mouseDown:",_d0);
}
}
break;
case CPLeftMouseDragged:
if(!_leftMouseDownView){
return objj_msgSend(objj_msgSend(_windowView,"hitTest:",_d2),"mouseDragged:",_d0);
}
return objj_msgSend(_leftMouseDownView,"mouseDragged:",_d0);
case CPRightMouseUp:
return objj_msgSend(_rightMouseDownView,"mouseUp:",_d0);
case CPRightMouseDown:
_rightMouseDownView=objj_msgSend(_windowView,"hitTest:",_d2);
return objj_msgSend(_rightMouseDownView,"mouseDown:",_d0);
case CPRightMouseDragged:
return objj_msgSend(_rightMouseDownView,"mouseDragged:",_d0);
case CPMouseMoved:
if(!_acceptsMouseMovedEvents){
return;
}
if(!_mouseEnteredStack){
_mouseEnteredStack=[];
}
var _d4=objj_msgSend(_windowView,"hitTest:",_d2);
if(objj_msgSend(_mouseEnteredStack,"count")&&objj_msgSend(_mouseEnteredStack,"lastObject")===_d4){
return objj_msgSend(_d4,"mouseMoved:",_d0);
}
var _d5=_d4,_d6=[];
while(_d5){
_d6.unshift(_d5);
_d5=objj_msgSend(_d5,"superview");
}
var _d7=MIN(_mouseEnteredStack.length,_d6.length);
while(_d7--){
if(_mouseEnteredStack[_d7]===_d6[_d7]){
break;
}
}
var _d8=_d7+1,_d9=_mouseEnteredStack.length;
if(_d8<_d9){
var _da=objj_msgSend(CPEvent,"mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:",CPMouseExited,_d2,objj_msgSend(_d0,"modifierFlags"),objj_msgSend(_d0,"timestamp"),_windowNumber,nil,-1,1,0);
for(;_d8<_d9;++_d8){
objj_msgSend(_mouseEnteredStack[_d8],"mouseExited:",_da);
}
}
_d8=_d7+1;
_d9=_d6.length;
if(_d8<_d9){
var _da=objj_msgSend(CPEvent,"mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:",CPMouseEntered,_d2,objj_msgSend(_d0,"modifierFlags"),objj_msgSend(_d0,"timestamp"),_windowNumber,nil,-1,1,0);
for(;_d8<_d9;++_d8){
objj_msgSend(_d6[_d8],"mouseEntered:",_da);
}
}
_mouseEnteredStack=_d6;
objj_msgSend(_d4,"mouseMoved:",_d0);
}
}
}),new objj_method(sel_getUid("windowNumber"),function(_db,_dc){
with(_db){
return _windowNumber;
}
}),new objj_method(sel_getUid("becomeKeyWindow"),function(_dd,_de){
with(_dd){
CPApp._keyWindow=_dd;
if(_firstResponder!==_dd&&objj_msgSend(_firstResponder,"respondsToSelector:",sel_getUid("becomeKeyWindow"))){
objj_msgSend(_firstResponder,"becomeKeyWindow");
}
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPWindowDidBecomeKeyNotification,_dd);
}
}),new objj_method(sel_getUid("canBecomeKeyWindow"),function(_df,_e0){
with(_df){
return YES;
}
}),new objj_method(sel_getUid("isKeyWindow"),function(_e1,_e2){
with(_e1){
return objj_msgSend(CPApp,"keyWindow")==_e1;
}
}),new objj_method(sel_getUid("makeKeyAndOrderFront:"),function(_e3,_e4,_e5){
with(_e3){
objj_msgSend(_e3,"orderFront:",_e3);
objj_msgSend(_e3,"makeKeyWindow");
objj_msgSend(_e3,"makeMainWindow");
}
}),new objj_method(sel_getUid("makeKeyWindow"),function(_e6,_e7){
with(_e6){
if(objj_msgSend(CPApp,"keyWindow")===_e6||!objj_msgSend(_e6,"canBecomeKeyWindow")){
return;
}
objj_msgSend(objj_msgSend(CPApp,"keyWindow"),"resignKeyWindow");
objj_msgSend(_e6,"becomeKeyWindow");
}
}),new objj_method(sel_getUid("resignKeyWindow"),function(_e8,_e9){
with(_e8){
if(_firstResponder!=_e8&&objj_msgSend(_firstResponder,"respondsToSelector:",sel_getUid("resignKeyWindow"))){
objj_msgSend(_firstResponder,"resignKeyWindow");
}
if(CPApp._keyWindow===_e8){
CPApp._keyWindow=nil;
}
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPWindowDidResignKeyNotification,_e8);
}
}),new objj_method(sel_getUid("dragImage:at:offset:event:pasteboard:source:slideBack:"),function(_ea,_eb,_ec,_ed,_ee,_ef,_f0,_f1,_f2){
with(_ea){
objj_msgSend(objj_msgSend(CPDragServer,"sharedDragServer"),"dragImage:fromWindow:at:offset:event:pasteboard:source:slideBack:",_ec,_ea,objj_msgSend(_ea,"convertBaseToGlobal:",_ed),_ee,_ef,_f0,_f1,_f2);
}
}),new objj_method(sel_getUid("_noteRegisteredDraggedTypes:"),function(_f3,_f4,_f5){
with(_f3){
if(!_f5){
return;
}
if(!_inclusiveRegisteredDraggedTypes){
_inclusiveRegisteredDraggedTypes=objj_msgSend(CPCountedSet,"set");
}
objj_msgSend(_inclusiveRegisteredDraggedTypes,"unionSet:",_f5);
}
}),new objj_method(sel_getUid("_noteUnregisteredDraggedTypes:"),function(_f6,_f7,_f8){
with(_f6){
if(!_f8){
return;
}
objj_msgSend(_inclusiveRegisteredDraggedTypes,"minusSet:",_f8);
if(objj_msgSend(_inclusiveRegisteredDraggedTypes,"count")===0){
_inclusiveRegisteredDraggedTypes=nil;
}
}
}),new objj_method(sel_getUid("dragView:at:offset:event:pasteboard:source:slideBack:"),function(_f9,_fa,_fb,_fc,_fd,_fe,_ff,_100,_101){
with(_f9){
objj_msgSend(objj_msgSend(CPDragServer,"sharedDragServer"),"dragView:fromWindow:at:offset:event:pasteboard:source:slideBack:",_fb,_f9,objj_msgSend(_f9,"convertBaseToGlobal:",_fc),_fd,_fe,_ff,_100,_101);
}
}),new objj_method(sel_getUid("registerForDraggedTypes:"),function(self,_102,_103){
with(self){
if(!_103){
return;
}
objj_msgSend(self,"_noteUnregisteredDraggedTypes:",_registeredDraggedTypes);
objj_msgSend(_registeredDraggedTypes,"addObjectsFromArray:",_103);
objj_msgSend(self,"_noteRegisteredDraggedTypes:",_registeredDraggedTypes);
_registeredDraggedTypesArray=nil;
}
}),new objj_method(sel_getUid("registeredDraggedTypes"),function(self,_104){
with(self){
if(!_registeredDraggedTypesArray){
_registeredDraggedTypesArray=objj_msgSend(_registeredDraggedTypes,"allObjects");
}
return _registeredDraggedTypesArray;
}
}),new objj_method(sel_getUid("unregisterDraggedTypes"),function(self,_105){
with(self){
objj_msgSend(self,"_noteUnregisteredDraggedTypes:",_registeredDraggedTypes);
_registeredDraggedTypes=objj_msgSend(CPSet,"set");
_registeredDraggedTypesArray=[];
}
}),new objj_method(sel_getUid("setDocumentEdited:"),function(self,_106,_107){
with(self){
if(_isDocumentEdited==_107){
return;
}
_isDocumentEdited=_107;
objj_msgSend(CPMenu,"_setMenuBarIconImageAlphaValue:",_isDocumentEdited?0.5:1);
objj_msgSend(_windowView,"setDocumentEdited:",_107);
}
}),new objj_method(sel_getUid("isDocumentEdited"),function(self,_108){
with(self){
return _isDocumentEdited;
}
}),new objj_method(sel_getUid("setDocumentSaving:"),function(self,_109,_10a){
with(self){
if(_isDocumentSaving==_10a){
return;
}
_isDocumentSaving=_10a;
objj_msgSend(self,"_synchronizeSaveMenuWithDocumentSaving");
objj_msgSend(_windowView,"windowDidChangeDocumentSaving");
}
}),new objj_method(sel_getUid("isDocumentSaving"),function(self,_10b){
with(self){
return _isDocumentSaving;
}
}),new objj_method(sel_getUid("_synchronizeSaveMenuWithDocumentSaving"),function(self,_10c){
with(self){
if(!objj_msgSend(self,"isMainWindow")){
return;
}
var _10d=objj_msgSend(CPApp,"mainMenu"),_10e=objj_msgSend(_10d,"indexOfItemWithTitle:",_isDocumentSaving?"Save":"Saving...");
if(_10e==CPNotFound){
return;
}
var item=objj_msgSend(_10d,"itemAtIndex:",_10e);
if(_isDocumentSaving){
_7=objj_msgSend(item,"image");
objj_msgSend(item,"setTitle:","Saving...");
objj_msgSend(item,"setImage:",_8);
objj_msgSend(item,"setEnabled:",NO);
}else{
objj_msgSend(item,"setTitle:","Save");
objj_msgSend(item,"setImage:",_7);
objj_msgSend(item,"setEnabled:",YES);
}
}
}),new objj_method(sel_getUid("performMiniaturize:"),function(self,_10f,_110){
with(self){
objj_msgSend(self,"miniaturize:",_110);
}
}),new objj_method(sel_getUid("miniaturize:"),function(self,_111,_112){
with(self){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPWindowWillMiniaturizeNotification,self);
objj_msgSend(objj_msgSend(self,"platformWindow"),"miniaturize:",_112);
objj_msgSend(self,"_updateMainAndKeyWindows");
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPWindowDidMiniaturizeNotification,self);
_isMiniaturized=YES;
}
}),new objj_method(sel_getUid("deminiaturize:"),function(self,_113,_114){
with(self){
objj_msgSend(objj_msgSend(self,"platformWindow"),"deminiaturize:",_114);
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPWindowDidDeminiaturizeNotification,self);
_isMiniaturized=NO;
}
}),new objj_method(sel_getUid("isMiniaturized"),function(self,_115){
with(self){
return _isMiniaturized;
}
}),new objj_method(sel_getUid("performClose:"),function(self,_116,_117){
with(self){
if(!(_styleMask&CPClosableWindowMask)){
return;
}
if(objj_msgSend(self,"isFullBridge")){
var _118=objj_msgSend(CPApp,"currentEvent");
if(objj_msgSend(_118,"type")===CPKeyDown&&objj_msgSend(_118,"characters")==="w"&&(objj_msgSend(_118,"modifierFlags")&CPPlatformActionKeyMask)){
objj_msgSend(objj_msgSend(self,"platformWindow"),"_propagateCurrentDOMEvent:",YES);
return;
}
}
if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("windowShouldClose:"))){
if(!objj_msgSend(_delegate,"windowShouldClose:",self)){
return;
}
}else{
if(objj_msgSend(self,"respondsToSelector:",sel_getUid("windowShouldClose:"))&&!objj_msgSend(self,"windowShouldClose:",self)){
return;
}
}
var _119=objj_msgSend(_windowController,"documents");
if(objj_msgSend(_119,"count")){
var _11a=objj_msgSend(_119,"indexOfObject:",objj_msgSend(_windowController,"document"));
objj_msgSend(_119[_11a],"shouldCloseWindowController:delegate:shouldCloseSelector:contextInfo:",_windowController,self,sel_getUid("_windowControllerContainingDocument:shouldClose:contextInfo:"),{documents:objj_msgSend(_119,"copy"),visited:0,index:_11a});
}else{
objj_msgSend(self,"close");
}
}
}),new objj_method(sel_getUid("_windowControllerContainingDocument:shouldClose:contextInfo:"),function(self,_11b,_11c,_11d,_11e){
with(self){
if(_11d){
var _11f=objj_msgSend(self,"windowController"),_120=_11e.documents,_121=objj_msgSend(_120,"count"),_122=++_11e.visited,_123=++_11e.index%_121;
objj_msgSend(_11c,"removeWindowController:",_11f);
if(_122<_121){
objj_msgSend(_11f,"setDocument:",_120[_123]);
objj_msgSend(_120[_123],"shouldCloseWindowController:delegate:shouldCloseSelector:contextInfo:",_windowController,self,sel_getUid("_windowControllerContainingDocument:shouldClose:contextInfo:"),_11e);
}else{
objj_msgSend(self,"close");
}
}
}
}),new objj_method(sel_getUid("close"),function(self,_124){
with(self){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPWindowWillCloseNotification,self);
objj_msgSend(self,"orderOut:",nil);
}
}),new objj_method(sel_getUid("isMainWindow"),function(self,_125){
with(self){
return objj_msgSend(CPApp,"mainWindow")==self;
}
}),new objj_method(sel_getUid("canBecomeMainWindow"),function(self,_126){
with(self){
if(objj_msgSend(self,"isVisible")){
return YES;
}
return NO;
}
}),new objj_method(sel_getUid("makeMainWindow"),function(self,_127){
with(self){
if(objj_msgSend(CPApp,"mainWindow")===self||!objj_msgSend(self,"canBecomeMainWindow")){
return;
}
objj_msgSend(objj_msgSend(CPApp,"mainWindow"),"resignMainWindow");
objj_msgSend(self,"becomeMainWindow");
}
}),new objj_method(sel_getUid("becomeMainWindow"),function(self,_128){
with(self){
CPApp._mainWindow=self;
objj_msgSend(self,"_synchronizeMenuBarTitleWithWindowTitle");
objj_msgSend(self,"_synchronizeSaveMenuWithDocumentSaving");
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPWindowDidBecomeMainNotification,self);
}
}),new objj_method(sel_getUid("resignMainWindow"),function(self,_129){
with(self){
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPWindowDidResignMainNotification,self);
if(CPApp._mainWindow===self){
CPApp._mainWindow=nil;
}
}
}),new objj_method(sel_getUid("_updateMainAndKeyWindows"),function(self,_12a){
with(self){
var _12b=objj_msgSend(CPApp,"orderedWindows"),_12c=objj_msgSend(_12b,"count");
if(objj_msgSend(self,"isKeyWindow")){
var _12d=objj_msgSend(CPApp,"keyWindow");
objj_msgSend(self,"resignKeyWindow");
if(_12d&&_12d!==self&&objj_msgSend(_12d,"canBecomeKeyWindow")){
objj_msgSend(_12d,"makeKeyWindow");
}else{
var _12e=objj_msgSend(CPApp,"mainMenu")._menuWindow;
for(var i=0;i<_12c;i++){
var _12f=_12b[i];
if(_12f===self||_12f===_12e){
continue;
}
if(objj_msgSend(_12f,"isVisible")&&objj_msgSend(_12f,"canBecomeKeyWindow")){
objj_msgSend(_12f,"makeKeyWindow");
break;
}
}
if(!objj_msgSend(CPApp,"keyWindow")){
objj_msgSend(_12e,"makeKeyWindow");
}
}
}
if(objj_msgSend(self,"isMainWindow")){
var _130=objj_msgSend(CPApp,"mainWindow");
objj_msgSend(self,"resignMainWindow");
if(_130&&_130!==self&&objj_msgSend(_130,"canBecomeMainWindow")){
objj_msgSend(_130,"makeMainWindow");
}else{
var _12e=objj_msgSend(CPApp,"mainMenu")._menuWindow;
for(var i=0;i<_12c;i++){
var _12f=_12b[i];
if(_12f===self||_12f===_12e){
continue;
}
if(objj_msgSend(_12f,"isVisible")&&objj_msgSend(_12f,"canBecomeMainWindow")){
objj_msgSend(_12f,"makeMainWindow");
break;
}
}
}
}
}
}),new objj_method(sel_getUid("toolbar"),function(self,_131){
with(self){
return _toolbar;
}
}),new objj_method(sel_getUid("setToolbar:"),function(self,_132,_133){
with(self){
if(_toolbar===_133){
return;
}
objj_msgSend(objj_msgSend(_133,"_window"),"setToolbar:",nil);
objj_msgSend(_toolbar,"_setWindow:",nil);
_toolbar=_133;
objj_msgSend(_toolbar,"_setWindow:",self);
objj_msgSend(self,"_noteToolbarChanged");
}
}),new objj_method(sel_getUid("toggleToolbarShown:"),function(self,_134,_135){
with(self){
var _136=objj_msgSend(self,"toolbar");
objj_msgSend(_136,"setVisible:",!objj_msgSend(_136,"isVisible"));
}
}),new objj_method(sel_getUid("_noteToolbarChanged"),function(self,_137){
with(self){
var _138=CGRectMakeCopy(objj_msgSend(self,"frame")),_139;
objj_msgSend(_windowView,"noteToolbarChanged");
if(_isFullPlatformWindow){
_139=objj_msgSend(_platformWindow,"visibleFrame");
}else{
_139=CGRectMakeCopy(objj_msgSend(self,"frame"));
_139.origin=_138.origin;
}
objj_msgSend(self,"setFrame:",_139);
}
}),new objj_method(sel_getUid("_setFrame:delegate:duration:curve:"),function(self,_13a,_13b,_13c,_13d,_13e){
with(self){
var _13f=objj_msgSend(objj_msgSend(_CPWindowFrameAnimation,"alloc"),"initWithWindow:targetFrame:",self,_13b);
objj_msgSend(_13f,"setDelegate:",_13c);
objj_msgSend(_13f,"setAnimationCurve:",_13e);
objj_msgSend(_13f,"setDuration:",_13d);
objj_msgSend(_13f,"startAnimation");
}
}),new objj_method(sel_getUid("_setAttachedSheetFrameOrigin"),function(self,_140){
with(self){
var _141=objj_msgSend(self,"attachedSheet");
var _142=objj_msgSend(objj_msgSend(self,"contentView"),"frame"),_143=CGRectMakeCopy(objj_msgSend(_141,"frame"));
_143.origin.y=CGRectGetMinY(_frame)+CGRectGetMinY(_142);
_143.origin.x=CGRectGetMinX(_frame)+FLOOR((CGRectGetWidth(_frame)-CGRectGetWidth(_143))/2);
objj_msgSend(_141,"setFrame:display:animate:",_143,YES,NO);
}
}),new objj_method(sel_getUid("_attachSheet:modalDelegate:didEndSelector:contextInfo:"),function(self,_144,_145,_146,_147,_148){
with(self){
var _149=objj_msgSend(_145,"frame");
_sheetContext={"sheet":_145,"modalDelegate":_146,"endSelector":_147,"contextInfo":_148,"frame":CGRectMakeCopy(_149),"returnCode":-1,"opened":NO};
objj_msgSend(self,"_attachSheetWindow:",_145);
}
}),new objj_method(sel_getUid("_attachSheetWindow:"),function(self,_14a,_14b){
with(self){
var _14c=objj_msgSend(_14b,"frame"),_14d=objj_msgSend(self,"frame"),_14e=objj_msgSend(_14b,"contentView");
objj_msgSend(self,"_setUpMasksForView:",_14e);
_14b._isSheet=YES;
_14b._parentView=self;
var _14f=_14d.origin.x+FLOOR((_14d.size.width-_14c.size.width)/2),_150=_14d.origin.y+objj_msgSend(objj_msgSend(self,"contentView"),"frame").origin.y,_151=CGRectMake(_14f,_150,_14c.size.width,0),_152=CGRectMake(_14f,_150,_14c.size.width,_14c.size.height);
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPWindowWillBeginSheetNotification,self);
objj_msgSend(CPApp,"runModalForWindow:",_14b);
objj_msgSend(_14b,"orderFront:",self);
objj_msgSend(_14b,"setFrame:display:animate:",_151,YES,NO);
_sheetContext["opened"]=YES;
objj_msgSend(_14b,"_setFrame:delegate:duration:curve:",_152,self,0.2,CPAnimationEaseOut);
objj_msgSend(_14b,"becomeKeyWindow");
}
}),new objj_method(sel_getUid("_detachSheetWindow"),function(self,_153){
with(self){
var _154=objj_msgSend(self,"attachedSheet"),_155=objj_msgSend(_154,"frame"),_156=CGRectMakeCopy(_155);
_156.size.height=0;
_sheetContext["frame"]=_155;
var _157=objj_msgSend(_154,"contentView");
objj_msgSend(self,"_setUpMasksForView:",_157);
_sheetContext["opened"]=NO;
objj_msgSend(_154,"_setFrame:delegate:duration:curve:",_156,self,0.2,CPAnimationEaseIn);
}
}),new objj_method(sel_getUid("animationDidEnd:"),function(self,_158,anim){
with(self){
var _159=_sheetContext["sheet"];
if(anim._window!=_159){
return;
}
var _15a=objj_msgSend(_159,"contentView");
if(_sheetContext["opened"]===YES){
objj_msgSend(self,"_restoreMasksForView:",_15a);
return;
}
objj_msgSend(CPApp,"stopModal");
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPWindowDidEndSheetNotification,self);
objj_msgSend(_159,"orderOut:",self);
var _15b=_sheetContext["frame"];
objj_msgSend(_159,"setFrame:",_15b);
objj_msgSend(self,"_restoreMasksForView:",_15a);
var _15c=_sheetContext["modalDelegate"],_15d=_sheetContext["endSelector"];
if(_15c!=nil&&_15d!=nil){
objj_msgSend(_15c,_15d,_159,_sheetContext["returnCode"],_sheetContext["contextInfo"]);
}
_sheetContext=nil;
_159._parentView=nil;
}
}),new objj_method(sel_getUid("_setUpMasksForView:"),function(self,_15e,_15f){
with(self){
var _160=objj_msgSend(_15f,"subviews");
objj_msgSend(_160,"addObject:",_15f);
for(var i=0,_161=objj_msgSend(_160,"count");i<_161;i++){
var view=objj_msgSend(_160,"objectAtIndex:",i),mask=objj_msgSend(view,"autoresizingMask"),_162=(mask&CPViewMinYMargin)?128:CPViewMinYMargin;
objj_msgSend(view,"setAutoresizingMask:",(mask|_162));
}
}
}),new objj_method(sel_getUid("_restoreMasksForView:"),function(self,_163,_164){
with(self){
var _165=objj_msgSend(_164,"subviews");
objj_msgSend(_165,"addObject:",_164);
for(var i=0,_166=objj_msgSend(_165,"count");i<_166;i++){
var view=objj_msgSend(_165,"objectAtIndex:",i),mask=objj_msgSend(view,"autoresizingMask"),_167=(mask&128)?128:CPViewMinYMargin;
objj_msgSend(view,"setAutoresizingMask:",(mask&(~_167)));
}
}
}),new objj_method(sel_getUid("attachedSheet"),function(self,_168){
with(self){
if(_sheetContext===nil){
return nil;
}
return _sheetContext["sheet"];
}
}),new objj_method(sel_getUid("isSheet"),function(self,_169){
with(self){
return _isSheet;
}
}),new objj_method(sel_getUid("becomesKeyOnlyIfNeeded"),function(self,_16a){
with(self){
return NO;
}
}),new objj_method(sel_getUid("worksWhenModal"),function(self,_16b){
with(self){
return NO;
}
}),new objj_method(sel_getUid("performKeyEquivalent:"),function(self,_16c,_16d){
with(self){
return objj_msgSend(objj_msgSend(self,"contentView"),"performKeyEquivalent:",_16d);
}
}),new objj_method(sel_getUid("keyDown:"),function(self,_16e,_16f){
with(self){
if(!objj_msgSend(_16f,"_couldBeKeyEquivalent")||!objj_msgSend(self,"performKeyEquivalent:",_16f)){
objj_msgSend(self,"interpretKeyEvents:",[_16f]);
}
}
}),new objj_method(sel_getUid("insertNewline:"),function(self,_170,_171){
with(self){
if(_defaultButton&&_defaultButtonEnabled){
objj_msgSend(_defaultButton,"performClick:",nil);
}
}
}),new objj_method(sel_getUid("insertTab:"),function(self,_172,_173){
with(self){
objj_msgSend(self,"selectNextKeyView:",nil);
}
}),new objj_method(sel_getUid("_dirtyKeyViewLoop"),function(self,_174){
with(self){
if(_autorecalculatesKeyViewLoop){
_keyViewLoopIsDirty=YES;
}
}
}),new objj_method(sel_getUid("_hasKeyViewLoop"),function(self,_175){
with(self){
var _176=[];
objj_msgSend(self,"_appendSubviewsOf:toArray:",_contentView,_176);
for(var i=0,_177=objj_msgSend(_176,"count");i<_177;i++){
if(_176[i]._nextKeyView){
return YES;
}
}
return NO;
}
}),new objj_method(sel_getUid("recalculateKeyViewLoop"),function(self,_178){
with(self){
var _179=[];
objj_msgSend(self,"_appendSubviewsOf:toArray:",_contentView,_179);
var _17a=objj_msgSend(_179,"sortedArrayUsingFunction:context:",_17b,_contentView),_17c=objj_msgSend(_17a,"count");
for(var i=0;i<_17c;i++){
objj_msgSend(_17a[i],"setNextKeyView:",_17a[(i+1)%_17c]);
}
_keyViewLoopIsDirty=NO;
}
}),new objj_method(sel_getUid("_appendSubviewsOf:toArray:"),function(self,_17d,_17e,_17f){
with(self){
var _180=objj_msgSend(_17e,"subviews"),_181=objj_msgSend(_180,"count");
while(_181--){
objj_msgSend(self,"_appendSubviewsOf:toArray:",_180[_181],_17f);
}
objj_msgSend(_17f,"addObject:",_17e);
}
}),new objj_method(sel_getUid("setAutorecalculatesKeyViewLoop:"),function(self,_182,_183){
with(self){
if(_autorecalculatesKeyViewLoop===_183){
return;
}
_autorecalculatesKeyViewLoop=_183;
if(_keyViewLoopIsDirty){
objj_msgSend(self,"recalculateKeyViewLoop");
}else{
if(_autorecalculatesKeyViewLoop){
objj_msgSend(self,"_dirtyKeyViewLoop");
}
}
}
}),new objj_method(sel_getUid("autorecalculatesKeyViewLoop"),function(self,_184){
with(self){
return _autorecalculatesKeyViewLoop;
}
}),new objj_method(sel_getUid("selectNextKeyView:"),function(self,_185,_186){
with(self){
if(objj_msgSend(_firstResponder,"isKindOfClass:",objj_msgSend(CPView,"class"))){
objj_msgSend(self,"selectKeyViewFollowingView:",_firstResponder);
}
}
}),new objj_method(sel_getUid("selectPreviousKeyView:"),function(self,_187,_188){
with(self){
if(objj_msgSend(_firstResponder,"isKindOfClass:",objj_msgSend(CPView,"class"))){
objj_msgSend(self,"selectKeyViewPrecedingView:",_firstResponder);
}
}
}),new objj_method(sel_getUid("selectKeyViewFollowingView:"),function(self,_189,_18a){
with(self){
if(_keyViewLoopIsDirty){
objj_msgSend(self,"recalculateKeyViewLoop");
}
objj_msgSend(self,"makeFirstResponder:",objj_msgSend(_18a,"nextValidKeyView"));
}
}),new objj_method(sel_getUid("selectKeyViewPrecedingView:"),function(self,_18b,_18c){
with(self){
if(_keyViewLoopIsDirty){
objj_msgSend(self,"recalculateKeyViewLoop");
}
objj_msgSend(self,"makeFirstResponder:",objj_msgSend(_18c,"previousValidKeyView"));
}
}),new objj_method(sel_getUid("setDefaultButtonCell:"),function(self,_18d,_18e){
with(self){
objj_msgSend(self,"setDefaultButton:",_18e);
}
}),new objj_method(sel_getUid("defaultButtonCell"),function(self,_18f){
with(self){
return objj_msgSend(self,"defaultButton");
}
}),new objj_method(sel_getUid("setDefaultButton:"),function(self,_190,_191){
with(self){
objj_msgSend(_defaultButton,"setDefaultButton:",NO);
_defaultButton=_191;
objj_msgSend(_defaultButton,"setDefaultButton:",YES);
}
}),new objj_method(sel_getUid("defaultButton"),function(self,_192){
with(self){
return _defaultButton;
}
}),new objj_method(sel_getUid("enableKeyEquivalentForDefaultButton"),function(self,_193){
with(self){
_defaultButtonEnabled=YES;
}
}),new objj_method(sel_getUid("enableKeyEquivalentForDefaultButtonCell"),function(self,_194){
with(self){
objj_msgSend(self,"enableKeyEquivalentForDefaultButton");
}
}),new objj_method(sel_getUid("disableKeyEquivalentForDefaultButton"),function(self,_195){
with(self){
_defaultButtonEnabled=NO;
}
}),new objj_method(sel_getUid("disableKeyEquivalentForDefaultButtonCell"),function(self,_196){
with(self){
objj_msgSend(self,"disableKeyEquivalentForDefaultButton");
}
})]);
class_addMethods(_a,[new objj_method(sel_getUid("initialize"),function(self,_197){
with(self){
if(self!=objj_msgSend(CPWindow,"class")){
return;
}
var _198=objj_msgSend(CPBundle,"bundleForClass:",objj_msgSend(CPWindow,"class"));
_8=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_198,"pathForResource:","CPProgressIndicator/CPProgressIndicatorSpinningStyleRegular.gif"),CGSizeMake(16,16));
}
}),new objj_method(sel_getUid("_windowViewClassForStyleMask:"),function(self,_199,_19a){
with(self){
if(_19a&CPHUDBackgroundWindowMask){
return _CPHUDWindowView;
}else{
if(_19a===CPBorderlessWindowMask){
return _CPBorderlessWindowView;
}else{
if(_19a&CPDocModalWindowMask){
return _CPDocModalWindowView;
}
}
}
return _CPStandardWindowView;
}
}),new objj_method(sel_getUid("_windowViewClassForFullPlatformWindowStyleMask:"),function(self,_19b,_19c){
with(self){
return _CPBorderlessBridgeWindowView;
}
}),new objj_method(sel_getUid("frameRectForContentRect:styleMask:"),function(self,_19d,_19e,_19f){
with(self){
return objj_msgSend(objj_msgSend(objj_msgSend(self,"class"),"_windowViewClassForStyleMask:",_19f),"frameRectForContentRect:",_19e);
}
})]);
var _17b=function(a,b,_1a0){
var _1a1=objj_msgSend(a,"convertRect:toView:",objj_msgSend(a,"bounds"),nil),_1a2=objj_msgSend(b,"convertRect:toView:",objj_msgSend(b,"bounds"),nil);
if(CGRectGetMinY(_1a1)<CGRectGetMinY(_1a2)){
return -1;
}else{
if(CGRectGetMinY(_1a1)==CGRectGetMinY(_1a2)&&CGRectGetMinX(_1a1)<CGRectGetMinX(_1a2)){
return -1;
}else{
if(CGRectGetMinX(_1a1)==CGRectGetMinX(_1a2)&&CGRectGetMinX(_1a1)==CGRectGetMinX(_1a2)){
return 0;
}else{
return 1;
}
}
}
};
var _9=objj_getClass("CPWindow");
if(!_9){
throw new SyntaxError("*** Could not find definition for class \"CPWindow\"");
}
var _a=_9.isa;
class_addMethods(_9,[new objj_method(sel_getUid("_synchronizeMenuBarTitleWithWindowTitle"),function(self,_1a3){
with(self){
if(!objj_msgSend(_windowController,"document")||!objj_msgSend(self,"isMainWindow")){
return;
}
objj_msgSend(CPMenu,"setMenuBarTitle:",_title);
}
})]);
var _9=objj_getClass("CPWindow");
if(!_9){
throw new SyntaxError("*** Could not find definition for class \"CPWindow\"");
}
var _a=_9.isa;
class_addMethods(_9,[new objj_method(sel_getUid("resizeWithOldPlatformWindowSize:"),function(self,_1a4,_1a5){
with(self){
if(objj_msgSend(self,"isFullPlatformWindow")){
return objj_msgSend(self,"setFrame:",objj_msgSend(_platformWindow,"visibleFrame"));
}
if(_autoresizingMask==CPWindowNotSizable){
return;
}
var _1a6=objj_msgSend(_platformWindow,"contentBounds"),_1a7=CGRectMakeCopy(_frame),dX=(CGRectGetWidth(_1a6)-_1a5.width)/(((_autoresizingMask&CPWindowMinXMargin)?1:0)+(_autoresizingMask&CPWindowWidthSizable?1:0)+(_autoresizingMask&CPWindowMaxXMargin?1:0)),dY=(CGRectGetHeight(_1a6)-_1a5.height)/((_autoresizingMask&CPWindowMinYMargin?1:0)+(_autoresizingMask&CPWindowHeightSizable?1:0)+(_autoresizingMask&CPWindowMaxYMargin?1:0));
if(_autoresizingMask&CPWindowMinXMargin){
_1a7.origin.x+=dX;
}
if(_autoresizingMask&CPWindowWidthSizable){
_1a7.size.width+=dX;
}
if(_autoresizingMask&CPWindowMinYMargin){
_1a7.origin.y+=dY;
}
if(_autoresizingMask&CPWindowHeightSizable){
_1a7.size.height+=dY;
}
objj_msgSend(self,"setFrame:",_1a7);
}
}),new objj_method(sel_getUid("setAutoresizingMask:"),function(self,_1a8,_1a9){
with(self){
_autoresizingMask=_1a9;
}
}),new objj_method(sel_getUid("autoresizingMask"),function(self,_1aa){
with(self){
return _autoresizingMask;
}
}),new objj_method(sel_getUid("convertBaseToGlobal:"),function(self,_1ab,_1ac){
with(self){
return objj_msgSend(CPPlatform,"isBrowser")?objj_msgSend(self,"convertBaseToPlatformWindow:",_1ac):objj_msgSend(self,"convertBaseToScreen:",_1ac);
}
}),new objj_method(sel_getUid("convertGlobalToBase:"),function(self,_1ad,_1ae){
with(self){
return objj_msgSend(CPPlatform,"isBrowser")?objj_msgSend(self,"convertPlatformWindowToBase:",_1ae):objj_msgSend(self,"convertScreenToBase:",_1ae);
}
}),new objj_method(sel_getUid("convertBaseToPlatformWindow:"),function(self,_1af,_1b0){
with(self){
if(objj_msgSend(self,"_sharesChromeWithPlatformWindow")){
return _1b0;
}
var _1b1=objj_msgSend(self,"frame").origin;
return {x:_1b0.x+_1b1.x,y:_1b0.y+_1b1.y};
}
}),new objj_method(sel_getUid("convertPlatformWindowToBase:"),function(self,_1b2,_1b3){
with(self){
if(objj_msgSend(self,"_sharesChromeWithPlatformWindow")){
return _1b3;
}
var _1b4=objj_msgSend(self,"frame").origin;
return {x:_1b3.x-_1b4.x,y:_1b3.y-_1b4.y};
}
}),new objj_method(sel_getUid("convertScreenToBase:"),function(self,_1b5,_1b6){
with(self){
return objj_msgSend(self,"convertPlatformWindowToBase:",objj_msgSend(_platformWindow,"convertScreenToBase:",_1b6));
}
}),new objj_method(sel_getUid("convertBaseToScreen:"),function(self,_1b7,_1b8){
with(self){
return objj_msgSend(_platformWindow,"convertBaseToScreen:",objj_msgSend(self,"convertBaseToPlatformWindow:",_1b8));
}
}),new objj_method(sel_getUid("_setSharesChromeWithPlatformWindow:"),function(self,_1b9,_1ba){
with(self){
if(_1ba&&objj_msgSend(CPPlatform,"isBrowser")){
return;
}
_sharesChromeWithPlatformWindow=_1ba;
objj_msgSend(self,"_updateShadow");
}
}),new objj_method(sel_getUid("_sharesChromeWithPlatformWindow"),function(self,_1bb){
with(self){
return _sharesChromeWithPlatformWindow;
}
}),new objj_method(sel_getUid("undoManager"),function(self,_1bc){
with(self){
if(_undoManager){
return _undoManager;
}
var _1bd=objj_msgSend(objj_msgSend(_windowController,"document"),"undoManager");
if(_1bd){
return _1bd;
}
if(_delegateRespondsToWindowWillReturnUndoManagerSelector){
return objj_msgSend(_delegate,"windowWillReturnUndoManager:",self);
}
if(!_undoManager){
_undoManager=objj_msgSend(objj_msgSend(CPUndoManager,"alloc"),"init");
}
return _undoManager;
}
}),new objj_method(sel_getUid("undo:"),function(self,_1be,_1bf){
with(self){
objj_msgSend(objj_msgSend(self,"undoManager"),"undo");
}
}),new objj_method(sel_getUid("redo:"),function(self,_1c0,_1c1){
with(self){
objj_msgSend(objj_msgSend(self,"undoManager"),"redo");
}
}),new objj_method(sel_getUid("containsPoint:"),function(self,_1c2,_1c3){
with(self){
return CGRectContainsPoint(_frame,_1c3);
}
})]);
var _9=objj_getClass("CPWindow");
if(!_9){
throw new SyntaxError("*** Could not find definition for class \"CPWindow\"");
}
var _a=_9.isa;
class_addMethods(_9,[new objj_method(sel_getUid("setFullBridge:"),function(self,_1c4,_1c5){
with(self){
objj_msgSend(self,"setFullPlatformWindow:",_1c5);
}
}),new objj_method(sel_getUid("isFullBridge"),function(self,_1c6){
with(self){
return objj_msgSend(self,"isFullPlatformWindow");
}
}),new objj_method(sel_getUid("convertBaseToBridge:"),function(self,_1c7,_1c8){
with(self){
return objj_msgSend(self,"convertBaseToPlatformWindow:",_1c8);
}
}),new objj_method(sel_getUid("convertBridgeToBase:"),function(self,_1c9,_1ca){
with(self){
return objj_msgSend(self,"convertPlatformWindowToBase:",_1ca);
}
})]);
var _1cb=function(_1cc,_1cd,_1ce){
return _1cc+(_1cd-_1cc)*_1ce;
};
var _9=objj_allocateClassPair(CPAnimation,"_CPWindowFrameAnimation"),_a=_9.isa;
class_addIvars(_9,[new objj_ivar("_window"),new objj_ivar("_startFrame"),new objj_ivar("_targetFrame")]);
objj_registerClassPair(_9);
class_addMethods(_9,[new objj_method(sel_getUid("initWithWindow:targetFrame:"),function(self,_1cf,_1d0,_1d1){
with(self){
self=objj_msgSendSuper({receiver:self,super_class:objj_getClass("_CPWindowFrameAnimation").super_class},"initWithDuration:animationCurve:",0.2,CPAnimationLinear);
if(self){
_window=_1d0;
_targetFrame=CGRectMakeCopy(_1d1);
_startFrame=CGRectMakeCopy(objj_msgSend(_window,"frame"));
}
return self;
}
}),new objj_method(sel_getUid("startAnimation"),function(self,_1d2){
with(self){
objj_msgSendSuper({receiver:self,super_class:objj_getClass("_CPWindowFrameAnimation").super_class},"startAnimation");
_window._isAnimating=YES;
}
}),new objj_method(sel_getUid("setCurrentProgress:"),function(self,_1d3,_1d4){
with(self){
objj_msgSendSuper({receiver:self,super_class:objj_getClass("_CPWindowFrameAnimation").super_class},"setCurrentProgress:",_1d4);
var _1d5=objj_msgSend(self,"currentValue");
if(_1d5==1){
_window._isAnimating=NO;
}
var _1d6=CGRectMake(_1cb(CGRectGetMinX(_startFrame),CGRectGetMinX(_targetFrame),_1d5),_1cb(CGRectGetMinY(_startFrame),CGRectGetMinY(_targetFrame),_1d5),_1cb(CGRectGetWidth(_startFrame),CGRectGetWidth(_targetFrame),_1d5),_1cb(CGRectGetHeight(_startFrame),CGRectGetHeight(_targetFrame),_1d5));
objj_msgSend(_window,"setFrame:display:animate:",_1d6,YES,NO);
}
})]);
_CPWindowFullPlatformWindowSessionMake=function(_1d7,_1d8,_1d9,_1da){
return {windowView:_1d7,contentRect:_1d8,hasShadow:_1d9,level:_1da};
};
CPStandardWindowShadowStyle=0;
CPMenuWindowShadowStyle=1;
CPPanelWindowShadowStyle=2;
CPCustomWindowShadowStyle=3;
objj_executeFile("_CPWindowView.j",YES);
objj_executeFile("_CPStandardWindowView.j",YES);
objj_executeFile("_CPDocModalWindowView.j",YES);
objj_executeFile("_CPHUDWindowView.j",YES);
objj_executeFile("_CPBorderlessWindowView.j",YES);
objj_executeFile("_CPBorderlessBridgeWindowView.j",YES);
objj_executeFile("CPDragServer.j",YES);
objj_executeFile("CPView.j",YES);
p;12;CPPlatform.jt;3964;@STATIC;1.0;I;21;Foundation/CPObject.jt;3919;
objj_executeFile("Foundation/CPObject.j",NO);
var _1=objj_allocateClassPair(CPObject,"CPBasePlatform"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_2,[new objj_method(sel_getUid("bootstrap"),function(_3,_4){
with(_3){
objj_msgSend(CPPlatformString,"bootstrap");
objj_msgSend(CPPlatformWindow,"setPrimaryPlatformWindow:",objj_msgSend(objj_msgSend(CPPlatformWindow,"alloc"),"_init"));
}
}),new objj_method(sel_getUid("isBrowser"),function(_5,_6){
with(_5){
return NO;
}
}),new objj_method(sel_getUid("supportsDragAndDrop"),function(_7,_8){
with(_7){
return NO;
}
}),new objj_method(sel_getUid("supportsNativeMainMenu"),function(_9,_a){
with(_9){
return NO;
}
}),new objj_method(sel_getUid("terminateApplication"),function(_b,_c){
with(_b){
}
}),new objj_method(sel_getUid("activateIgnoringOtherApps:"),function(_d,_e,_f){
with(_d){
}
}),new objj_method(sel_getUid("deactivate"),function(_10,_11){
with(_10){
}
}),new objj_method(sel_getUid("hideOtherApplications:"),function(_12,_13,_14){
with(_12){
}
}),new objj_method(sel_getUid("hide:"),function(_15,_16,_17){
with(_15){
}
})]);
if(typeof window["CPPlatformEnableHTMLDragAndDrop"]==="undefined"){
CPPlatformEnableHTMLDragAndDrop=NO;
}
CPPlatformDidClearBodyElementNotification="CPPlatformDidClearBodyElementNotification";
CPPlatformWillClearBodyElementNotification="CPPlatformWillClearBodyElementNotification";
var _18=NO,_19=nil,_1a=new RegExp("\\bcpdontremove\\b","g");
var _1=objj_allocateClassPair(CPBasePlatform,"CPPlatform"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_2,[new objj_method(sel_getUid("initialize"),function(_1b,_1c){
with(_1b){
if(_1b!==objj_msgSend(CPPlatform,"class")){
return;
}
_18=objj_msgSend(CPPlatform,"isBrowser");
if(document.documentElement){
document.documentElement.style.overflow="hidden";
}
}
}),new objj_method(sel_getUid("isBrowser"),function(_1d,_1e){
with(_1d){
return typeof window.cpIsDesktop==="undefined";
}
}),new objj_method(sel_getUid("supportsDragAndDrop"),function(_1f,_20){
with(_1f){
return CPFeatureIsCompatible(CPHTMLDragAndDropFeature)&&(CPPlatformEnableHTMLDragAndDrop||!objj_msgSend(_1f,"isBrowser"));
}
}),new objj_method(sel_getUid("supportsNativeMainMenu"),function(_21,_22){
with(_21){
return (typeof window["cpSetMainMenu"]==="function");
}
}),new objj_method(sel_getUid("terminateApplication"),function(_23,_24){
with(_23){
if(typeof window["cpTerminate"]==="function"){
window.cpTerminate();
}
}
}),new objj_method(sel_getUid("activateIgnoringOtherApps:"),function(_25,_26,_27){
with(_25){
if(typeof window["cpActivateIgnoringOtherApps"]==="function"){
window.cpActivateIgnoringOtherApps(!!_27);
}
}
}),new objj_method(sel_getUid("deactivate"),function(_28,_29){
with(_28){
if(typeof window["cpDeactivate"]==="function"){
window.cpDeactivate();
}
}
}),new objj_method(sel_getUid("hideOtherApplications:"),function(_2a,_2b,_2c){
with(_2a){
if(typeof window["cpHideOtherApplications"]==="function"){
window.cpHideOtherApplications();
}
}
}),new objj_method(sel_getUid("hide:"),function(_2d,_2e,_2f){
with(_2d){
if(typeof window["cpHide"]==="function"){
window.cpHide();
}
}
}),new objj_method(sel_getUid("mainBodyElement"),function(_30,_31){
with(_30){
if(!_19){
_19=document.getElementById("cappuccino-body")||document.body;
}
return _19;
}
}),new objj_method(sel_getUid("initializeScreenIfNecessary"),function(_32,_33){
with(_32){
if(!_18){
return;
}
_18=NO;
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPPlatformWillClearBodyElementNotification,_32);
var _34=objj_msgSend(_32,"mainBodyElement");
var _35=_34.childNodes,_36=_35.length;
while(_36--){
var _37=_35[_36];
if(!_37.className||_37.className.match(_1a)===null){
_34.removeChild(_37);
}
}
_34.style.overflow="hidden";
objj_msgSend(objj_msgSend(CPNotificationCenter,"defaultCenter"),"postNotificationName:object:",CPPlatformDidClearBodyElementNotification,_32);
}
})]);
p;18;CPPlatformString.jt;2733;@STATIC;1.0;I;21;Foundation/CPObject.jt;2688;
objj_executeFile("Foundation/CPObject.j",NO);
var _1=objj_allocateClassPair(CPObject,"CPBasePlatformString"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_2,[new objj_method(sel_getUid("bootstrap"),function(_3,_4){
with(_3){
}
}),new objj_method(sel_getUid("sizeOfString:withFont:forWidth:"),function(_5,_6,_7,_8,_9){
with(_5){
return {width:0,height:0};
}
})]);
var _a=nil,_b=nil,_c=nil,_d=nil;
var _1=objj_allocateClassPair(CPBasePlatformString,"CPPlatformString"),_2=_1.isa;
objj_registerClassPair(_1);
class_addMethods(_2,[new objj_method(sel_getUid("bootstrap"),function(_e,_f){
with(_e){
objj_msgSend(_e,"createDOMElements");
}
}),new objj_method(sel_getUid("createDOMElements"),function(_10,_11){
with(_10){
var _12;
_c=document.createElement("iframe");
_c.name="iframe_"+FLOOR(RAND()*10000);
_c.className="cpdontremove";
_12=_c.style;
_12.position="absolute";
_12.left="-100px";
_12.top="-100px";
_12.width="1px";
_12.height="1px";
_12.borderWidth="0px";
_12.overflow="hidden";
_12.zIndex=100000000000;
var _13=objj_msgSend(CPPlatform,"mainBodyElement");
_13.appendChild(_c);
var _14=(_c.contentDocument||_c.contentWindow.document);
_14.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"+"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\"><head></head><body></body></html>");
_14.close();
var _15=_14.createElement("div");
_15.style.position="absolute";
_15.style.width="100000px";
_14.body.appendChild(_15);
_b=_14.createElement("span");
_12=_b.style;
_12.position="absolute";
_12.visibility="visible";
_12.padding="0px";
_12.margin="0px";
_12.whiteSpace="pre";
_a=_14.createElement("span");
_12=_a.style;
_12.display="block";
_12.position="absolute";
_12.visibility="visible";
_12.padding="0px";
_12.margin="0px";
_12.width="1px";
_12.wordWrap="break-word";
try{
_12.whiteSpace="pre";
_12.whiteSpace="-o-pre-wrap";
_12.whiteSpace="-pre-wrap";
_12.whiteSpace="-moz-pre-wrap";
_12.whiteSpace="pre-wrap";
}
catch(e){
_12.whiteSpace="pre";
}
_15.appendChild(_b);
_15.appendChild(_a);
}
}),new objj_method(sel_getUid("sizeOfString:withFont:forWidth:"),function(_16,_17,_18,_19,_1a){
with(_16){
if(!_19){
if(!_d){
_d=objj_msgSend(CPFont,"systemFontOfSize:",12);
}
_19=_d;
}
if(!_c){
objj_msgSend(_16,"createDOMElements");
}
var _1b;
if(!_1a){
_1b=_b;
}else{
_1b=_a;
_1b.style.width=ROUND(_1a)+"px";
}
_1b.style.font=objj_msgSend(_19,"cssString");
if(CPFeatureIsCompatible(CPJavascriptInnerTextFeature)){
_1b.innerText=_18;
}else{
if(CPFeatureIsCompatible(CPJavascriptTextContentFeature)){
_1b.textContent=_18;
}
}
return {width:_1b.clientWidth,height:_1b.clientHeight};
}
})]);
p;18;CPPlatformWindow.jt;5267;@STATIC;1.0;I;21;Foundation/CPObject.ji;22;CPPlatformWindow+DOM.jt;5195;
objj_executeFile("Foundation/CPObject.j",NO);
var _1=NULL;
var _2=objj_allocateClassPair(CPObject,"CPPlatformWindow"),_3=_2.isa;
class_addIvars(_2,[new objj_ivar("_contentRect"),new objj_ivar("_level"),new objj_ivar("_hasShadow"),new objj_ivar("_shadowStyle"),new objj_ivar("_DOMWindow"),new objj_ivar("_DOMBodyElement"),new objj_ivar("_DOMFocusElement"),new objj_ivar("_windowLevels"),new objj_ivar("_windowLayers"),new objj_ivar("_mouseIsDown"),new objj_ivar("_mouseDownWindow"),new objj_ivar("_lastMouseUp"),new objj_ivar("_lastMouseDown"),new objj_ivar("_charCodes"),new objj_ivar("_keyCode"),new objj_ivar("_lastKey"),new objj_ivar("_capsLockActive"),new objj_ivar("_ignoreNativeCopyOrCutEvent"),new objj_ivar("_ignoreNativePastePreparation"),new objj_ivar("_DOMEventMode"),new objj_ivar("_DOMPasteboardElement"),new objj_ivar("_pasteboardKeyDownEvent"),new objj_ivar("_overriddenEventType")]);
objj_registerClassPair(_2);
class_addMethods(_2,[new objj_method(sel_getUid("initWithContentRect:"),function(_4,_5,_6){
with(_4){
_4=objj_msgSendSuper({receiver:_4,super_class:objj_getClass("CPPlatformWindow").super_class},"init");
if(_4){
_contentRect={origin:{x:_6.origin.x,y:_6.origin.y},size:{width:_6.size.width,height:_6.size.height}};
_windowLevels=[];
_windowLayers=objj_msgSend(CPDictionary,"dictionary");
_charCodes={};
}
return _4;
}
}),new objj_method(sel_getUid("init"),function(_7,_8){
with(_7){
return objj_msgSend(_7,"initWithContentRect:",{origin:{x:0,y:0},size:{width:400,height:500}});
}
}),new objj_method(sel_getUid("contentRect"),function(_9,_a){
with(_9){
return {origin:{x:_contentRect.origin.x,y:_contentRect.origin.y},size:{width:_contentRect.size.width,height:_contentRect.size.height}};
}
}),new objj_method(sel_getUid("contentBounds"),function(_b,_c){
with(_b){
var _d=objj_msgSend(_b,"contentRect");
_d.origin={x:0,y:0};
return _d;
}
}),new objj_method(sel_getUid("visibleFrame"),function(_e,_f){
with(_e){
var _10=objj_msgSend(_e,"contentBounds");
_10.origin=CGPointMakeZero();
if(objj_msgSend(CPMenu,"menuBarVisible")&&objj_msgSend(CPPlatformWindow,"primaryPlatformWindow")===_e){
var _11=objj_msgSend(objj_msgSend(CPApp,"mainMenu"),"menuBarHeight");
_10.origin.y+=_11;
_10.size.height-=_11;
}
return _10;
}
}),new objj_method(sel_getUid("usableContentFrame"),function(_12,_13){
with(_12){
return objj_msgSend(_12,"visibleFrame");
}
}),new objj_method(sel_getUid("setContentRect:"),function(_14,_15,_16){
with(_14){
if(!_16||((_contentRect.origin.x==_16.origin.x&&_contentRect.origin.y==_16.origin.y)&&(_contentRect.size.width==_16.size.width&&_contentRect.size.height==_16.size.height))){
return;
}
_contentRect={origin:{x:_16.origin.x,y:_16.origin.y},size:{width:_16.size.width,height:_16.size.height}};
objj_msgSend(_14,"updateNativeContentRect");
}
}),new objj_method(sel_getUid("updateFromNativeContentRect"),function(_17,_18){
with(_17){
objj_msgSend(_17,"setContentRect:",objj_msgSend(_17,"nativeContentRect"));
}
}),new objj_method(sel_getUid("convertBaseToScreen:"),function(_19,_1a,_1b){
with(_19){
var _1c=objj_msgSend(_19,"contentRect");
return {x:_1b.x+(_1c.origin.x),y:_1b.y+(_1c.origin.y)};
}
}),new objj_method(sel_getUid("convertScreenToBase:"),function(_1d,_1e,_1f){
with(_1d){
var _20=objj_msgSend(_1d,"contentRect");
return {x:_1f.x-(_20.origin.x),y:_1f.y-(_20.origin.y)};
}
}),new objj_method(sel_getUid("isVisible"),function(_21,_22){
with(_21){
return _DOMWindow!==NULL;
}
}),new objj_method(sel_getUid("deminiaturize:"),function(_23,_24,_25){
with(_23){
if(_DOMWindow&&typeof _DOMWindow["cpDeminiaturize"]==="function"){
_DOMWindow.cpDeminiaturize();
}
}
}),new objj_method(sel_getUid("miniaturize:"),function(_26,_27,_28){
with(_26){
if(_DOMWindow&&typeof _DOMWindow["cpMiniaturize"]==="function"){
_DOMWindow.cpMiniaturize();
}
}
}),new objj_method(sel_getUid("moveWindow:fromLevel:toLevel:"),function(_29,_2a,_2b,_2c,_2d){
with(_29){
if(!_2b._isVisible){
return;
}
var _2e=objj_msgSend(_29,"layerAtLevel:create:",_2c,NO),_2f=objj_msgSend(_29,"layerAtLevel:create:",_2d,YES);
objj_msgSend(_2e,"removeWindow:",_2b);
objj_msgSend(_2f,"insertWindow:atIndex:",_2b,CPNotFound);
}
}),new objj_method(sel_getUid("setLevel:"),function(_30,_31,_32){
with(_30){
_level=_32;
if(_DOMWindow&&_DOMWindow.cpSetLevel){
_DOMWindow.cpSetLevel(_32);
}
}
}),new objj_method(sel_getUid("setHasShadow:"),function(_33,_34,_35){
with(_33){
_hasShadow=_35;
if(_DOMWindow&&_DOMWindow.cpSetHasShadow){
_DOMWindow.cpSetHasShadow(_35);
}
}
}),new objj_method(sel_getUid("setShadowStyle:"),function(_36,_37,_38){
with(_36){
_shadowStyle=_38;
if(_DOMWindow&&_DOMWindow.cpSetShadowStyle){
_shadowStyle.cpSetShadowStyle(_38);
}
}
}),new objj_method(sel_getUid("supportsFullPlatformWindows"),function(_39,_3a){
with(_39){
return objj_msgSend(CPPlatform,"isBrowser");
}
})]);
class_addMethods(_3,[new objj_method(sel_getUid("visiblePlatformWindows"),function(_3b,_3c){
with(_3b){
return objj_msgSend(CPSet,"set");
}
}),new objj_method(sel_getUid("primaryPlatformWindow"),function(_3d,_3e){
with(_3d){
return _1;
}
}),new objj_method(sel_getUid("setPrimaryPlatformWindow:"),function(_3f,_40,_41){
with(_3f){
_1=_41;
}
})]);
objj_executeFile("CPPlatformWindow+DOM.j",YES);
p;18;CPDOMWindowLayer.jt;2089;@STATIC;1.0;I;20;Foundation/CPArray.jI;21;Foundation/CPObject.jt;2019;
objj_executeFile("Foundation/CPArray.j",NO);
objj_executeFile("Foundation/CPObject.j",NO);
var _1=objj_allocateClassPair(CPObject,"CPDOMWindowLayer"),_2=_1.isa;
class_addIvars(_1,[new objj_ivar("_level"),new objj_ivar("_windows"),new objj_ivar("_DOMElement")]);
objj_registerClassPair(_1);
class_addMethods(_1,[new objj_method(sel_getUid("initWithLevel:"),function(_3,_4,_5){
with(_3){
_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPDOMWindowLayer").super_class},"init");
if(_3){
_level=_5;
_windows=[];
_DOMElement=document.createElement("div");
_DOMElement.style.position="absolute";
_DOMElement.style.top="0px";
_DOMElement.style.left="0px";
_DOMElement.style.width="1px";
_DOMElement.style.height="1px";
}
return _3;
}
}),new objj_method(sel_getUid("level"),function(_6,_7){
with(_6){
return _level;
}
}),new objj_method(sel_getUid("removeWindow:"),function(_8,_9,_a){
with(_8){
if(!_a._isVisible){
return;
}
var _b=_a._index,_c=_windows.length-1;
_DOMElement.removeChild(_a._DOMElement);
objj_msgSend(_windows,"removeObjectAtIndex:",_a._index);
for(;_b<_c;++_b){
_windows[_b]._index=_b;
_windows[_b]._DOMElement.style.zIndex=_b;
}
_a._isVisible=NO;
}
}),new objj_method(sel_getUid("insertWindow:atIndex:"),function(_d,_e,_f,_10){
with(_d){
var _11=objj_msgSend(_windows,"count"),_12=(_10==CPNotFound?_11:_10),_13=_f._isVisible;
if(_13){
_12=MIN(_12,_f._index);
objj_msgSend(_windows,"removeObjectAtIndex:",_f._index);
}else{
++_11;
}
if(_10==CPNotFound||_10>=_11){
objj_msgSend(_windows,"addObject:",_f);
}else{
objj_msgSend(_windows,"insertObject:atIndex:",_f,_10);
}
for(;_12<_11;++_12){
_windows[_12]._index=_12;
_windows[_12]._DOMElement.style.zIndex=_12;
}
if(_f._DOMElement.parentNode!==_DOMElement){
_DOMElement.appendChild(_f._DOMElement);
_f._isVisible=YES;
if(objj_msgSend(_f,"isFullBridge")){
objj_msgSend(_f,"setFrame:",objj_msgSend(_f._platformWindow,"usableContentFrame"));
}
}
}
}),new objj_method(sel_getUid("orderedWindows"),function(_14,_15){
with(_14){
return _windows;
}
})]);
p;22;CPPlatformWindow+DOM.jt;28514;@STATIC;1.0;I;21;Foundation/CPObject.jI;22;Foundation/CPRunLoop.ji;9;CPEvent.ji;17;CPCompatibility.ji;18;CPDOMWindowLayer.ji;12;CPPlatform.ji;18;CPPlatformWindow.ji;26;CPPlatformWindow+DOMKeys.jt;28312;
objj_executeFile("Foundation/CPObject.j",NO);
objj_executeFile("Foundation/CPRunLoop.j",NO);
objj_executeFile("CPEvent.j",YES);
objj_executeFile("CPCompatibility.j",YES);
objj_executeFile("CPDOMWindowLayer.j",YES);
objj_executeFile("CPPlatform.j",YES);
objj_executeFile("CPPlatformWindow.j",YES);
objj_executeFile("CPPlatformWindow+DOMKeys.j",YES);
var _1=objj_msgSend(CPSet,"set");
var _2,_3,_4;
var _5={},_6={},_7={61:187,59:186};
_5[CPKeyCodes.A]=YES;
var _8=objj_msgSend(CPPlatform,"supportsDragAndDrop");
var _9=objj_getClass("CPPlatformWindow");
if(!_9){
throw new SyntaxError("*** Could not find definition for class \"CPPlatformWindow\"");
}
var _a=_9.isa;
class_addMethods(_9,[new objj_method(sel_getUid("_init"),function(_b,_c){
with(_b){
_b=objj_msgSendSuper({receiver:_b,super_class:objj_getClass("CPPlatformWindow").super_class},"init");
if(_b){
_DOMWindow=window;
_contentRect={origin:{x:0,y:0},size:{width:0,height:0}};
_windowLevels=[];
_windowLayers=objj_msgSend(CPDictionary,"dictionary");
objj_msgSend(_b,"registerDOMWindow");
objj_msgSend(_b,"updateFromNativeContentRect");
_charCodes={};
}
return _b;
}
}),new objj_method(sel_getUid("nativeContentRect"),function(_d,_e){
with(_d){
if(!_DOMWindow){
return objj_msgSend(_d,"contentRect");
}
if(_DOMWindow.cpFrame){
return _DOMWindow.cpFrame();
}
var _f={origin:{x:0,y:0},size:{width:0,height:0}};
if(window.screenTop){
_f.origin={x:_DOMWindow.screenLeft,y:_DOMWindow.screenTop};
}else{
if(window.screenX){
_f.origin={x:_DOMWindow.screenX,y:_DOMWindow.screenY};
}
}
if(_DOMWindow.innerWidth){
_f.size={width:_DOMWindow.innerWidth,height:_DOMWindow.innerHeight};
}else{
if(document.documentElement&&document.documentElement.clientWidth){
_f.size={width:_DOMWindow.document.documentElement.clientWidth,height:_DOMWindow.document.documentElement.clientHeight};
}else{
_f.size={width:_DOMWindow.document.body.clientWidth,height:_DOMWindow.document.body.clientHeight};
}
}
return _f;
}
}),new objj_method(sel_getUid("updateNativeContentRect"),function(_10,_11){
with(_10){
if(!_DOMWindow){
return;
}
if(typeof _DOMWindow["cpSetFrame"]==="function"){
return _DOMWindow.cpSetFrame(objj_msgSend(_10,"contentRect"));
}
var _12=objj_msgSend(_10,"contentRect").origin,_13=objj_msgSend(_10,"nativeContentRect").origin;
if(_12.x!==_13.x||_12.y!==_13.y){
_DOMWindow.moveBy(_12.x-_13.x,_12.y-_13.y);
}
var _14=objj_msgSend(_10,"contentRect").size,_15=objj_msgSend(_10,"nativeContentRect").size;
if(_14.width!==_15.width||_14.height!==_15.height){
_DOMWindow.resizeBy(_14.width-_15.width,_14.height-_15.height);
}
}
}),new objj_method(sel_getUid("orderBack:"),function(_16,_17,_18){
with(_16){
if(_DOMWindow){
_DOMWindow.blur();
}
}
}),new objj_method(sel_getUid("createDOMElements"),function(_19,_1a){
with(_19){
var _1b=_DOMWindow.document;
_DOMFocusElement=_1b.createElement("input");
_DOMFocusElement.style.position="absolute";
_DOMFocusElement.style.zIndex="-1000";
_DOMFocusElement.style.opacity="0";
_DOMFocusElement.style.filter="alpha(opacity=0)";
_DOMFocusElement.className="cpdontremove";
_DOMBodyElement.appendChild(_DOMFocusElement);
_DOMPasteboardElement=_1b.createElement("textarea");
_DOMPasteboardElement.style.position="absolute";
_DOMPasteboardElement.style.top="-10000px";
_DOMPasteboardElement.style.zIndex="999";
_DOMPasteboardElement.className="cpdontremove";
_DOMBodyElement.appendChild(_DOMPasteboardElement);
_DOMPasteboardElement.blur();
}
}),new objj_method(sel_getUid("registerDOMWindow"),function(_1c,_1d){
with(_1c){
var _1e=_DOMWindow.document;
_DOMBodyElement=_1e.getElementById("cappuccino-body")||_1e.body;
if(objj_msgSend(CPPlatform,"supportsDragAndDrop")){
_DOMBodyElement.style["-khtml-user-select"]="none";
}
_DOMBodyElement.webkitTouchCallout="none";
objj_msgSend(_1c,"createDOMElements");
objj_msgSend(_1c,"_addLayers");
var _1f=objj_msgSend(_1c,"class"),_20=class_getMethodImplementation(_1f,sel_getUid("dragEvent:")),_21=function(_22){
_20(_1c,nil,_22);
},_23=sel_getUid("resizeEvent:"),_24=class_getMethodImplementation(_1f,_23),_25=function(_26){
_24(_1c,nil,_26);
},_27=sel_getUid("copyEvent:"),_28=class_getMethodImplementation(_1f,_27),_29=function(_2a){
_28(_1c,nil,_2a);
},_2b=sel_getUid("pasteEvent:"),_2c=class_getMethodImplementation(_1f,_2b),_2d=function(_2e){
_2c(_1c,nil,_2e);
},_2f=sel_getUid("keyEvent:"),_30=class_getMethodImplementation(_1f,_2f),_31=function(_32){
_30(_1c,nil,_32);
},_33=sel_getUid("mouseEvent:"),_34=class_getMethodImplementation(_1f,_33),_35=function(_36){
_34(_1c,nil,_36);
},_37=sel_getUid("scrollEvent:"),_38=class_getMethodImplementation(_1f,_37),_39=function(_3a){
_38(_1c,nil,_3a);
},_3b=sel_getUid("touchEvent:"),_3c=class_getMethodImplementation(_1f,_3b),_3d=function(_3e){
_3c(_1c,nil,_3e);
};
if(_1e.addEventListener){
if(objj_msgSend(CPPlatform,"supportsDragAndDrop")){
_1e.addEventListener("dragstart",_21,NO);
_1e.addEventListener("drag",_21,NO);
_1e.addEventListener("dragend",_21,NO);
_1e.addEventListener("dragover",_21,NO);
_1e.addEventListener("dragleave",_21,NO);
_1e.addEventListener("drop",_21,NO);
}
_1e.addEventListener("mouseup",_35,NO);
_1e.addEventListener("mousedown",_35,NO);
_1e.addEventListener("mousemove",_35,NO);
_1e.addEventListener("beforecopy",_29,NO);
_1e.addEventListener("beforecut",_29,NO);
_1e.addEventListener("beforepaste",_2d,NO);
_1e.addEventListener("keyup",_31,NO);
_1e.addEventListener("keydown",_31,NO);
_1e.addEventListener("keypress",_31,NO);
_1e.addEventListener("touchstart",_3d,NO);
_1e.addEventListener("touchend",_3d,NO);
_1e.addEventListener("touchmove",_3d,NO);
_1e.addEventListener("touchcancel",_3d,NO);
_DOMWindow.addEventListener("DOMMouseScroll",_39,NO);
_DOMWindow.addEventListener("mousewheel",_39,NO);
_DOMWindow.addEventListener("resize",_25,NO);
_DOMWindow.addEventListener("unload",function(){
objj_msgSend(_1c,"updateFromNativeContentRect");
objj_msgSend(_1c,"_removeLayers");
_1e.removeEventListener("mouseup",_35,NO);
_1e.removeEventListener("mousedown",_35,NO);
_1e.removeEventListener("mousemove",_35,NO);
_1e.removeEventListener("keyup",_31,NO);
_1e.removeEventListener("keydown",_31,NO);
_1e.removeEventListener("keypress",_31,NO);
_1e.removeEventListener("beforecopy",_29,NO);
_1e.removeEventListener("beforecut",_29,NO);
_1e.removeEventListener("beforepaste",_2d,NO);
_1e.removeEventListener("touchstart",_3d,NO);
_1e.removeEventListener("touchend",_3d,NO);
_1e.removeEventListener("touchmove",_3d,NO);
_DOMWindow.removeEventListener("resize",_25,NO);
_DOMWindow.removeEventListener("DOMMouseScroll",_39,NO);
_DOMWindow.removeEventListener("mousewheel",_39,NO);
objj_msgSend(_1,"removeObject:",_1c);
_1c._DOMWindow=nil;
},NO);
}else{
_1e.attachEvent("onmouseup",_35);
_1e.attachEvent("onmousedown",_35);
_1e.attachEvent("onmousemove",_35);
_1e.attachEvent("ondblclick",_35);
_1e.attachEvent("onkeyup",_31);
_1e.attachEvent("onkeydown",_31);
_1e.attachEvent("onkeypress",_31);
_DOMWindow.attachEvent("onresize",_25);
_DOMWindow.onmousewheel=_39;
_1e.onmousewheel=_39;
_DOMBodyElement.ondrag=function(){
return NO;
};
_DOMBodyElement.onselectstart=function(){
return _DOMWindow.event.srcElement===_DOMPasteboardElement;
};
_DOMWindow.attachEvent("onbeforeunload",function(){
objj_msgSend(_1c,"updateFromNativeContentRect");
objj_msgSend(_1c,"_removeLayers");
_1e.detachEvent("onmouseup",_35);
_1e.detachEvent("onmousedown",_35);
_1e.detachEvent("onmousemove",_35);
_1e.detachEvent("ondblclick",_35);
_1e.detachEvent("onkeyup",_31);
_1e.detachEvent("onkeydown",_31);
_1e.detachEvent("onkeypress",_31);
_DOMWindow.detachEvent("onresize",_25);
_DOMWindow.onmousewheel=NULL;
_1e.onmousewheel=NULL;
_DOMBodyElement.ondrag=NULL;
_DOMBodyElement.onselectstart=NULL;
objj_msgSend(_1,"removeObject:",_1c);
_1c._DOMWindow=nil;
},NO);
}
}
}),new objj_method(sel_getUid("orderFront:"),function(_3f,_40,_41){
with(_3f){
if(_DOMWindow){
return _DOMWindow.focus();
}
_DOMWindow=window.open("","_blank","menubar=no,location=no,resizable=yes,scrollbars=no,status=no,left="+(_contentRect.origin.x)+",top="+(_contentRect.origin.y)+",width="+(_contentRect.size.width)+",height="+(_contentRect.size.height));
objj_msgSend(_1,"addObject:",_3f);
_DOMWindow.document.write("<html><head></head><body style = 'background-color:transparent;'></body></html>");
_DOMWindow.document.close();
if(!objj_msgSend(CPPlatform,"isBrowser")){
_DOMWindow.cpWindowNumber=objj_msgSend(_3f._only,"windowNumber");
_DOMWindow.cpSetFrame(_contentRect);
_DOMWindow.cpSetLevel(_level);
_DOMWindow.cpSetHasShadow(_hasShadow);
_DOMWindow.cpSetShadowStyle(_shadowStyle);
}
objj_msgSend(_3f,"registerDOMWindow");
_DOMBodyElement.style.cursor=objj_msgSend(objj_msgSend(CPCursor,"currentCursor"),"_cssString");
}
}),new objj_method(sel_getUid("orderOut:"),function(_42,_43,_44){
with(_42){
if(!_DOMWindow){
return;
}
_DOMWindow.close();
}
}),new objj_method(sel_getUid("dragEvent:"),function(_45,_46,_47){
with(_45){
var _48=_47.type,_49=objj_msgSend(CPDragServer,"sharedDragServer"),_4a={x:_47.clientX,y:_47.clientY},_4b=objj_msgSend(_CPDOMDataTransferPasteboard,"DOMDataTransferPasteboard");
objj_msgSend(_4b,"_setDataTransfer:",_47.dataTransfer);
if(_47.type==="dragstart"){
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
objj_msgSend(_4b,"_setPasteboard:",objj_msgSend(_49,"draggingPasteboard"));
var _4c=objj_msgSend(_49,"draggedWindow"),_4d=objj_msgSend(_4c,"frame"),_4e=_4c._DOMElement;
_4e.style.left=-(_4d.size.width)+"px";
_4e.style.top=-(_4d.size.height)+"px";
_DOMBodyElement.appendChild(_4e);
var _4f=objj_msgSend(_49,"draggingOffset");
_47.dataTransfer.setDragImage(_4e,_4f.width,_4f.height);
_47.dataTransfer.effectAllowed="all";
objj_msgSend(_49,"draggingStartedInPlatformWindow:globalLocation:",_45,objj_msgSend(CPPlatform,"isBrowser")?_4a:{x:_47.screenX,y:_47.screenY});
}else{
if(_48==="drag"){
var y=_47.screenY;
if(CPFeatureIsCompatible(CPHTML5DragAndDropSourceYOffBy1)){
y-=1;
}
objj_msgSend(_49,"draggingSourceUpdatedWithGlobalLocation:",objj_msgSend(CPPlatform,"isBrowser")?_4a:{x:_47.screenX,y:y});
}else{
if(_48==="dragover"||_48==="dragleave"){
if(_47.preventDefault){
_47.preventDefault();
}
var _50="none",_51=objj_msgSend(_49,"draggingUpdatedInPlatformWindow:location:",_45,_4a);
if(_51===CPDragOperationMove||_51===CPDragOperationGeneric||_51===CPDragOperationPrivate){
_50="move";
}else{
if(_51===CPDragOperationCopy){
_50="copy";
}else{
if(_51===CPDragOperationLink){
_50="link";
}
}
}
_47.dataTransfer.dropEffect=_50;
}else{
if(_48==="dragend"){
var _50=_47.dataTransfer.dropEffect;
if(_50==="move"){
_51=CPDragOperationMove;
}else{
if(_50==="copy"){
_51=CPDragOperationCopy;
}else{
if(_50==="link"){
_51=CPDragOperationLink;
}else{
_51=CPDragOperationNone;
}
}
}
objj_msgSend(_49,"draggingEndedInPlatformWindow:globalLocation:operation:",_45,objj_msgSend(CPPlatform,"isBrowser")?_4a:{x:_47.screenX,y:_47.screenY},_51);
}else{
objj_msgSend(_49,"performDragOperationInPlatformWindow:",_45);
if(_47.preventDefault){
_47.preventDefault();
}
if(_47.stopPropagation){
_47.stopPropagation();
}
}
}
}
}
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
}
}),new objj_method(sel_getUid("keyEvent:"),function(_52,_53,_54){
with(_52){
var _55,_56=_54.timeStamp?_54.timeStamp:new Date(),_57=(_54.target||_54.srcElement),_58=objj_msgSend(objj_msgSend(CPApp,"keyWindow"),"windowNumber"),_59=(_54.shiftKey?CPShiftKeyMask:0)|(_54.ctrlKey?CPControlKeyMask:0)|(_54.altKey?CPAlternateKeyMask:0)|(_54.metaKey?CPCommandKeyMask:0);
_4=!!(!(_59&(CPControlKeyMask|CPCommandKeyMask))||_6[String.fromCharCode(_54.keyCode||_54.charCode).toLowerCase()]||_5[_54.keyCode]);
var _5a=NO,_5b=NO,_5c=nil;
switch(_54.type){
case "keydown":
if(_54.keyCode.keyCode in _7){
_keyCode=_7[_54.keyCode];
}else{
_keyCode=_54.keyCode;
}
var _5d=String.fromCharCode(_keyCode).toLowerCase();
_5c=(_59&CPShiftKeyMask||_capsLockActive)?_5d.toUpperCase():_5d;
if(_keyCode===CPKeyCodes.CAPS_LOCK){
_capsLockActive=YES;
}
if(_59&(CPControlKeyMask|CPCommandKeyMask)){
var _5e=objj_msgSend(_52,"_validateCopyCutOrPasteEvent:flags:",_54,_59);
if(_5d==="v"&&_5e){
if(!_ignoreNativePastePreparation){
_DOMPasteboardElement.select();
_DOMPasteboardElement.value="";
}
_5a=YES;
}else{
if((_5d=="c"||_5d=="x")&&_5e){
_5b=YES;
if(_ignoreNativeCopyOrCutEvent){
break;
}
}
}
}else{
if(CPKeyCodes.firesKeyPressEvent(_keyCode,_lastKey,_54.shiftKey,_54.ctrlKey,_54.altKey)){
_4=NO;
break;
}else{
}
}
case "keypress":
if(_54.type==="keypress"&&(_59&(CPControlKeyMask|CPCommandKeyMask))){
break;
}
var _5f=_keyCode,_60=_54.keyCode||_54.charCode,_61=(_charCodes[_5f]!=nil);
_lastKey=_5f;
_charCodes[_5f]=_60;
var _5d=_5c||String.fromCharCode(_60),_62=_5d.toLowerCase();
if(!_5c&&(_59&CPCommandKeyMask)&&((_59&CPShiftKeyMask)||_capsLockActive)){
_5d=_5d.toUpperCase();
}
_55=objj_msgSend(CPEvent,"keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:",CPKeyDown,location,_59,_56,_58,nil,_5d,_62,_61,_5f);
if(_5a){
_pasteboardKeyDownEvent=_55;
window.setNativeTimeout(function(){
objj_msgSend(_52,"_checkPasteboardElement");
},0);
}
break;
case "keyup":
var _5f=_54.keyCode,_60=_charCodes[_5f];
_keyCode=-1;
_lastKey=-1;
_charCodes[_5f]=nil;
_ignoreNativeCopyOrCutEvent=NO;
_ignoreNativePastePreparation=NO;
if(_5f===CPKeyCodes.CAPS_LOCK){
_capsLockActive=NO;
}
var _5d=String.fromCharCode(_60),_62=_5d.toLowerCase();
if(!(_59&CPShiftKeyMask)&&(_59&CPCommandKeyMask)&&!_capsLockActive){
_5d=_62;
}
_55=objj_msgSend(CPEvent,"keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:",CPKeyUp,location,_59,_56,_58,nil,_5d,_62,NO,_5f);
break;
}
if(_55&&!_5a){
_55._DOMEvent=_54;
objj_msgSend(CPApp,"sendEvent:",_55);
if(_5b){
objj_msgSend(_52,"_primePasteboardElement");
}
}
if(_4){
_3(_54,_52);
}
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
}
}),new objj_method(sel_getUid("copyEvent:"),function(_63,_64,_65){
with(_63){
if(objj_msgSend(_63,"_validateCopyCutOrPasteEvent:flags:",_65,CPPlatformActionKeyMask)&&!_ignoreNativeCopyOrCutEvent){
var cut=_65.type==="beforecut",_66=cut?CPKeyCodes.X:CPKeyCodes.C,_67=cut?"x":"c",_68=_65.timeStamp?_65.timeStamp:new Date(),_69=objj_msgSend(objj_msgSend(CPApp,"keyWindow"),"windowNumber"),_6a=CPPlatformActionKeyMask;
event=objj_msgSend(CPEvent,"keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:",CPKeyDown,location,_6a,_68,_69,nil,_67,_67,NO,_66);
event._DOMEvent=_65;
objj_msgSend(CPApp,"sendEvent:",event);
objj_msgSend(_63,"_primePasteboardElement");
_ignoreNativeCopyOrCutEvent=YES;
}
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
}
}),new objj_method(sel_getUid("pasteEvent:"),function(_6b,_6c,_6d){
with(_6b){
if(objj_msgSend(_6b,"_validateCopyCutOrPasteEvent:flags:",_6d,CPPlatformActionKeyMask)){
_DOMPasteboardElement.focus();
_DOMPasteboardElement.select();
_DOMPasteboardElement.value="";
_ignoreNativePastePreparation=YES;
}
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
}
}),new objj_method(sel_getUid("_validateCopyCutOrPasteEvent:flags:"),function(_6e,_6f,_70,_71){
with(_6e){
return (((_70.target||_70.srcElement).nodeName.toUpperCase()!=="INPUT"&&(_70.target||_70.srcElement).nodeName.toUpperCase()!=="TEXTAREA")||_70.target===_DOMPasteboardElement)&&(_71&CPPlatformActionKeyMask);
}
}),new objj_method(sel_getUid("_primePasteboardElement"),function(_72,_73){
with(_72){
var _74=objj_msgSend(CPPasteboard,"generalPasteboard"),_75=objj_msgSend(_74,"types");
if(_75.length){
if(objj_msgSend(_75,"indexOfObjectIdenticalTo:",CPStringPboardType)!=CPNotFound){
_DOMPasteboardElement.value=objj_msgSend(_74,"stringForType:",CPStringPboardType);
}else{
_DOMPasteboardElement.value=objj_msgSend(_74,"_generateStateUID");
}
_DOMPasteboardElement.focus();
_DOMPasteboardElement.select();
window.setNativeTimeout(function(){
objj_msgSend(_72,"_clearPasteboardElement");
},0);
}
}
}),new objj_method(sel_getUid("_checkPasteboardElement"),function(_76,_77){
with(_76){
var _78=_DOMPasteboardElement.value;
if(objj_msgSend(_78,"length")){
var _79=objj_msgSend(CPPasteboard,"generalPasteboard");
if(objj_msgSend(_79,"_stateUID")!=_78){
objj_msgSend(_79,"declareTypes:owner:",[CPStringPboardType],_76);
objj_msgSend(_79,"setString:forType:",_78,CPStringPboardType);
}
}
objj_msgSend(_76,"_clearPasteboardElement");
objj_msgSend(CPApp,"sendEvent:",_pasteboardKeyDownEvent);
_pasteboardKeyDownEvent=nil;
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
}
}),new objj_method(sel_getUid("_clearPasteboardElement"),function(_7a,_7b){
with(_7a){
_DOMPasteboardElement.value="";
_DOMPasteboardElement.blur();
}
}),new objj_method(sel_getUid("scrollEvent:"),function(_7c,_7d,_7e){
with(_7c){
if(!_7e){
_7e=window.event;
}
if(CPFeatureIsCompatible(CPJavaScriptMouseWheelValues_8_15)){
var x=0,y=0,_7f=_7e.target;
while(_7f.nodeType!==1){
_7f=_7f.parentNode;
}
if(_7f.offsetParent){
do{
x+=_7f.offsetLeft;
y+=_7f.offsetTop;
}while(_7f=_7f.offsetParent);
}
var _80={x:(x+((_7e.clientX-8)/15)),y:(y+((_7e.clientY-8)/15))};
}else{
var _80={x:_7e.clientX,y:_7e.clientY};
}
var _81=0,_82=0,_83=0,_84=_7e.timeStamp?_7e.timeStamp:new Date(),_85=(_7e.shiftKey?CPShiftKeyMask:0)|(_7e.ctrlKey?CPControlKeyMask:0)|(_7e.altKey?CPAlternateKeyMask:0)|(_7e.metaKey?CPCommandKeyMask:0);
_4=YES;
var _86=objj_msgSend(_7c,"hitTest:",_80);
if(!_86){
return;
}
var _83=objj_msgSend(_86,"windowNumber");
_80=objj_msgSend(_86,"convertBridgeToBase:",_80);
if(typeof _7e.wheelDeltaX!="undefined"){
_81=_7e.wheelDeltaX/120;
_82=_7e.wheelDeltaY/120;
}else{
if(_7e.wheelDelta){
_82=_7e.wheelDelta/120;
}else{
if(_7e.detail){
_82=-_7e.detail/3;
}else{
return;
}
}
}
if(!CPFeatureIsCompatible(CPJavaScriptNegativeMouseWheelValues)){
_81=-_81;
_82=-_82;
}
var _87=objj_msgSend(CPEvent,"mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:",CPScrollWheel,_80,_85,_84,_83,nil,-1,1,0);
_87._DOMEvent=_7e;
_87._deltaX=_81;
_87._deltaY=_82;
objj_msgSend(CPApp,"sendEvent:",_87);
if(_4){
_3(_7e,_7c);
}
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
}
}),new objj_method(sel_getUid("resizeEvent:"),function(_88,_89,_8a){
with(_88){
if(objj_msgSend(CPPlatform,"isBrowser")){
objj_msgSend(CPApp._activeMenu,"cancelTracking");
}
var _8b=objj_msgSend(_88,"contentRect").size;
objj_msgSend(_88,"updateFromNativeContentRect");
var _8c=_windowLevels,_8d=_windowLayers,_8e=_8c.length;
while(_8e--){
var _8f=objj_msgSend(_8d,"objectForKey:",_8c[_8e])._windows,_90=_8f.length;
while(_90--){
objj_msgSend(_8f[_90],"resizeWithOldPlatformWindowSize:",_8b);
}
}
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
}
}),new objj_method(sel_getUid("touchEvent:"),function(_91,_92,_93){
with(_91){
if(_93.touches&&(_93.touches.length==1||(_93.touches.length==0&&_93.changedTouches.length==1))){
var _94={};
switch(_93.type){
case CPDOMEventTouchStart:
_94.type=CPDOMEventMouseDown;
break;
case CPDOMEventTouchEnd:
_94.type=CPDOMEventMouseUp;
break;
case CPDOMEventTouchMove:
_94.type=CPDOMEventMouseMoved;
break;
case CPDOMEventTouchCancel:
_94.type=CPDOMEventMouseUp;
break;
}
var _95=_93.touches.length?_93.touches[0]:_93.changedTouches[0];
_94.clientX=_95.clientX;
_94.clientY=_95.clientY;
_94.timestamp=_93.timestamp;
_94.target=_93.target;
_94.shiftKey=_94.ctrlKey=_94.altKey=_94.metaKey=false;
_94.preventDefault=function(){
if(_93.preventDefault){
_93.preventDefault();
}
};
_94.stopPropagation=function(){
if(_93.stopPropagation){
_93.stopPropagation();
}
};
objj_msgSend(_91,"mouseEvent:",_94);
return;
}else{
if(_93.preventDefault){
_93.preventDefault();
}
if(_93.stopPropagation){
_93.stopPropagation();
}
}
}
}),new objj_method(sel_getUid("mouseEvent:"),function(_96,_97,_98){
with(_96){
var _99=_overriddenEventType||_98.type;
if(_99==="dblclick"){
_overriddenEventType=CPDOMEventMouseDown;
objj_msgSend(_96,"mouseEvent:",_98);
_overriddenEventType=CPDOMEventMouseUp;
objj_msgSend(_96,"mouseEvent:",_98);
_overriddenEventType=nil;
return;
}
var _9a,_9b={x:_98.clientX,y:_98.clientY},_9c=_98.timeStamp?_98.timeStamp:new Date(),_9d=(_98.target||_98.srcElement),_9e=0,_9f=(_98.shiftKey?CPShiftKeyMask:0)|(_98.ctrlKey?CPControlKeyMask:0)|(_98.altKey?CPAlternateKeyMask:0)|(_98.metaKey?CPCommandKeyMask:0);
_4=YES;
if(_mouseDownWindow){
_9e=objj_msgSend(_mouseDownWindow,"windowNumber");
}else{
var _a0=objj_msgSend(_96,"hitTest:",_9b);
if((_98.type===CPDOMEventMouseDown)&&_a0){
_mouseDownWindow=_a0;
}
_9e=objj_msgSend(_a0,"windowNumber");
}
if(_9e){
_9b=objj_msgSend(CPApp._windows[_9e],"convertPlatformWindowToBase:",_9b);
}
if(_99==="mouseup"){
if(_mouseIsDown){
_9a=_a1(_98,CPLeftMouseUp,_9b,_9f,_9c,_9e,nil,-1,_2(_lastMouseUp,_9c,_9b),0);
_mouseIsDown=NO;
_lastMouseUp=_9a;
_mouseDownWindow=nil;
}
if(_DOMEventMode){
_DOMEventMode=NO;
return;
}
}else{
if(_99==="mousedown"){
if(_9d.tagName==="INPUT"&&_9d!=_DOMFocusElement){
if(objj_msgSend(CPPlatform,"supportsDragAndDrop")){
_DOMBodyElement.setAttribute("draggable","false");
_DOMBodyElement.style["-khtml-user-drag"]="none";
}
_DOMEventMode=YES;
_mouseIsDown=YES;
objj_msgSend(CPApp,"sendEvent:",objj_msgSend(CPEvent,"mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:",CPLeftMouseDown,_9b,_9f,_9c,_9e,nil,-1,_2(_lastMouseDown,_9c,_9b),0));
objj_msgSend(CPApp,"sendEvent:",objj_msgSend(CPEvent,"mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:",CPLeftMouseUp,_9b,_9f,_9c,_9e,nil,-1,_2(_lastMouseDown,_9c,_9b),0));
return;
}else{
if(objj_msgSend(CPPlatform,"supportsDragAndDrop")){
_DOMBodyElement.setAttribute("draggable","true");
_DOMBodyElement.style["-khtml-user-drag"]="element";
}
}
_9a=_a1(_98,CPLeftMouseDown,_9b,_9f,_9c,_9e,nil,-1,_2(_lastMouseDown,_9c,_9b),0);
_mouseIsDown=YES;
_lastMouseDown=_9a;
}else{
if(_DOMEventMode){
return;
}
_9a=_a1(_98,_mouseIsDown?CPLeftMouseDragged:CPMouseMoved,_9b,_9f,_9c,_9e,nil,-1,1,0);
}
}
var _a2=objj_msgSend(objj_msgSend(CPDragServer,"sharedDragServer"),"isDragging");
if(_9a&&(!_a2||!_8)){
_9a._DOMEvent=_98;
objj_msgSend(CPApp,"sendEvent:",_9a);
}
if(_4&&(!_8||_99!=="mousedown"&&!_a2)){
_3(_98,_96);
}
objj_msgSend(objj_msgSend(CPRunLoop,"currentRunLoop"),"limitDateForMode:",CPDefaultRunLoopMode);
}
}),new objj_method(sel_getUid("orderedWindowsAtLevel:"),function(_a3,_a4,_a5){
with(_a3){
var _a6=objj_msgSend(_a3,"layerAtLevel:create:",_a5,NO);
if(!_a6){
return [];
}
return objj_msgSend(_a6,"orderedWindows");
}
}),new objj_method(sel_getUid("layerAtLevel:create:"),function(_a7,_a8,_a9,_aa){
with(_a7){
var _ab=objj_msgSend(_windowLayers,"objectForKey:",_a9);
if(!_ab&&_aa){
_ab=objj_msgSend(objj_msgSend(CPDOMWindowLayer,"alloc"),"initWithLevel:",_a9);
objj_msgSend(_windowLayers,"setObject:forKey:",_ab,_a9);
var low=0,_ac=_windowLevels.length-1,_ad;
while(low<=_ac){
_ad=FLOOR((low+_ac)/2);
if(_windowLevels[_ad]>_a9){
_ac=_ad-1;
}else{
low=_ad+1;
}
}
var _ae=0;
if(_ad!==undefined){
_ae=_windowLevels[_ad]>_a9?_ad:_ad+1;
}
objj_msgSend(_windowLevels,"insertObject:atIndex:",_a9,_ae);
_ab._DOMElement.style.zIndex=_a9;
_DOMBodyElement.appendChild(_ab._DOMElement);
}
return _ab;
}
}),new objj_method(sel_getUid("order:window:relativeTo:"),function(_af,_b0,_b1,_b2,_b3){
with(_af){
objj_msgSend(CPPlatform,"initializeScreenIfNecessary");
var _b4=objj_msgSend(_af,"layerAtLevel:create:",objj_msgSend(_b2,"level"),_b1!==CPWindowOut);
if(_b1===CPWindowOut){
return objj_msgSend(_b4,"removeWindow:",_b2);
}
var _b5=CPNotFound;
if(_b3){
_b5=_b1===CPWindowAbove?_b3._index+1:_b3._index;
}
objj_msgSend(_b4,"insertWindow:atIndex:",_b2,_b5);
}
}),new objj_method(sel_getUid("_removeLayers"),function(_b6,_b7){
with(_b6){
var _b8=_windowLevels,_b9=_windowLayers,_ba=_b8.length;
while(_ba--){
var _bb=objj_msgSend(_b9,"objectForKey:",_b8[_ba]);
_DOMBodyElement.removeChild(_bb._DOMElement);
}
}
}),new objj_method(sel_getUid("_addLayers"),function(_bc,_bd){
with(_bc){
var _be=_windowLevels,_bf=_windowLayers,_c0=_be.length;
while(_c0--){
var _c1=objj_msgSend(_bf,"objectForKey:",_be[_c0]);
_DOMBodyElement.appendChild(_c1._DOMElement);
}
}
}),new objj_method(sel_getUid("_dragHitTest:pasteboard:"),function(_c2,_c3,_c4,_c5){
with(_c2){
var _c6=_windowLevels,_c7=_windowLayers,_c8=_c6.length;
while(_c8--){
if(_c6[_c8]>=CPDraggingWindowLevel){
continue;
}
var _c9=objj_msgSend(_c7,"objectForKey:",_c6[_c8])._windows,_ca=_c9.length;
while(_ca--){
var _cb=_c9[_ca];
if(objj_msgSend(_cb,"_sharesChromeWithPlatformWindow")){
return objj_msgSend(_cb,"_dragHitTest:pasteboard:",_c4,_c5);
}
if(objj_msgSend(_cb,"containsPoint:",_c4)){
return objj_msgSend(_cb,"_dragHitTest:pasteboard:",_c4,_c5);
}
}
}
return nil;
}
}),new objj_method(sel_getUid("_propagateCurrentDOMEvent:"),function(_cc,_cd,_ce){
with(_cc){
_4=!_ce;
}
}),new objj_method(sel_getUid("_willPropagateCurrentDOMEvent"),function(_cf,_d0){
with(_cf){
return !_4;
}
}),new objj_method(sel_getUid("hitTest:"),function(_d1,_d2,_d3){
with(_d1){
if(_d1._only){
return _d1._only;
}
var _d4=_windowLevels,_d5=_windowLayers,_d6=_d4.length,_d7=nil;
while(_d6--&&!_d7){
var _d8=objj_msgSend(_d5,"objectForKey:",_d4[_d6])._windows,_d9=_d8.length;
while(_d9--&&!_d7){
var _da=_d8[_d9];
if(!_da._ignoresMouseEvents&&objj_msgSend(_da,"containsPoint:",_d3)){
_d7=_da;
}
}
}
return _d7;
}
})]);
class_addMethods(_a,[new objj_method(sel_getUid("visiblePlatformWindows"),function(_db,_dc){
with(_db){
if(objj_msgSend(objj_msgSend(CPPlatformWindow,"primaryPlatformWindow"),"isVisible")){
var set=objj_msgSend(CPSet,"setWithSet:",_1);
objj_msgSend(set,"addObject:",objj_msgSend(CPPlatformWindow,"primaryPlatformWindow"));
return set;
}else{
return _1;
}
}
}),new objj_method(sel_getUid("preventCharacterKeysFromPropagating:"),function(_dd,_de,_df){
with(_dd){
for(var i=_df.length;i>0;i--){
_6[""+_df[i-1].toLowerCase()]=YES;
}
}
}),new objj_method(sel_getUid("preventCharacterKeyFromPropagating:"),function(_e0,_e1,_e2){
with(_e0){
_6[_e2.toLowerCase()]=YES;
}
}),new objj_method(sel_getUid("clearCharacterKeysToPreventFromPropagating"),function(_e3,_e4){
with(_e3){
_6={};
}
}),new objj_method(sel_getUid("preventKeyCodesFromPropagating:"),function(_e5,_e6,_e7){
with(_e5){
for(var i=_e7.length;i>0;i--){
_5[_e7[i-1]]=YES;
}
}
}),new objj_method(sel_getUid("preventKeyCodeFromPropagating:"),function(_e8,_e9,_ea){
with(_e8){
_5[_ea]=YES;
}
}),new objj_method(sel_getUid("clearKeyCodesToPreventFromPropagating"),function(_eb,_ec){
with(_eb){
_5={};
}
})]);
var _ed=objj_msgSend(CPEvent,"class");
var _a1=function(_ee,_ef,_f0,_f1,_f2,_f3,_f4,_f5,_f6,_f7){
_ee.isa=_ed;
_ee._type=_ef;
_ee._location=_f0;
_ee._modifierFlags=_f1;
_ee._timestamp=_f2;
_ee._windowNumber=_f3;
_ee._window=nil;
_ee._context=_f4;
_ee._eventNumber=_f5;
_ee._clickCount=_f6;
_ee._pressure=_f7;
return _ee;
};
var _f8=5,_f9=(typeof document!="undefined"&&document.addEventListener)?350:1000;
var _2=function(_fa,_fb,_fc){
if(!_fa){
return 1;
}
var _fd=objj_msgSend(_fa,"locationInWindow");
return (_fb-objj_msgSend(_fa,"timestamp")<_f9&&ABS(_fd.x-_fc.x)<_f8&&ABS(_fd.y-_fc.y)<_f8)?objj_msgSend(_fa,"clickCount")+1:1;
};
var _3=function(_fe,_ff){
_fe.cancelBubble=true;
_fe.returnValue=false;
if(_fe.preventDefault){
_fe.preventDefault();
}
if(_fe.stopPropagation){
_fe.stopPropagation();
}
if(_fe.type===CPDOMEventMouseDown){
_ff._DOMFocusElement.focus();
_ff._DOMFocusElement.blur();
}
};
CPWindowObjectList=function(){
var _100=objj_msgSend(CPPlatformWindow,"visiblePlatformWindows"),_101=objj_msgSend(_100,"objectEnumerator"),_102=nil,_103=[];
while(_102=objj_msgSend(_101,"nextObject")){
var _104=_102._windowLevels,_105=_102._windowLayers,_106=_104.length;
while(_106--){
var _107=objj_msgSend(_105,"objectForKey:",_104[_106])._windows,_108=_107.length;
while(_108--){
_103.push(_107[_108]);
}
}
}
return _103;
};
CPWindowList=function(){
var _109=CPWindowObjectList(),_10a=[];
for(var i=0,_10b=objj_msgSend(_109,"count");i<_10b;i++){
_10a.push(objj_msgSend(_109[i],"windowNumber"));
}
return _10a;
};
p;26;CPPlatformWindow+DOMKeys.jt;2336;@STATIC;1.0;t;2317;
CPKeyCodes={BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229};
CPKeyCodes.firesKeyPressEvent=function(_1,_2,_3,_4,_5){
if(!CPFeatureIsCompatible(CPJavascriptRemedialKeySupport)){
return true;
}
if(CPBrowserIsOperatingSystem(CPMacOperatingSystem)&&_5){
return CPKeyCodes.isCharacterKey(_1);
}
if(_5&&!_4){
return false;
}
if(CPBrowserIsEngine(CPInternetExplorerBrowserEngine)&&!_3&&(_4||_5)){
return false;
}
if(CPBrowserIsEngine(CPInternetExplorerBrowserEngine)&&_4&&_2==_1){
return false;
}
switch(_1){
case CPKeyCodes.ENTER:
return true;
case CPKeyCodes.ESC:
return !CPBrowserIsEngine(CPWebKitBrowserEngine);
}
return CPKeyCodes.isCharacterKey(_1);
};
CPKeyCodes.isCharacterKey=function(_6){
if(_6>=CPKeyCodes.ZERO&&_6<=CPKeyCodes.NINE){
return true;
}
if(_6>=CPKeyCodes.NUM_ZERO&&_6<=CPKeyCodes.NUM_MULTIPLY){
return true;
}
if(_6>=CPKeyCodes.A&&_6<=CPKeyCodes.Z){
return true;
}
switch(_6){
case CPKeyCodes.SPACE:
case CPKeyCodes.QUESTION_MARK:
case CPKeyCodes.NUM_PLUS:
case CPKeyCodes.NUM_MINUS:
case CPKeyCodes.NUM_PERIOD:
case CPKeyCodes.NUM_DIVISION:
case CPKeyCodes.SEMICOLON:
case CPKeyCodes.DASH:
case CPKeyCodes.EQUALS:
case CPKeyCodes.COMMA:
case CPKeyCodes.PERIOD:
case CPKeyCodes.SLASH:
case CPKeyCodes.APOSTROPHE:
case CPKeyCodes.SINGLE_QUOTE:
case CPKeyCodes.OPEN_SQUARE_BRACKET:
case CPKeyCodes.BACKSLASH:
case CPKeyCodes.CLOSE_SQUARE_BRACKET:
return true;
default:
return false;
}
};
e;